This is a Railroad Motorcar, or Speeder. Smaller models, like this one, were routinely used to inspect the many miles of track for defects. Larger versions would carry half a dozen workers and pull a few trailers loaded with spikes & tools, to handle track maintenance.
Use of speeders has been phased out over the past couple decades in favor of Hy-Rail Vehicles, which are standard road vehicles with retractable guide wheels that can operate on road or rail.
This particular example is a Fairmont MT-14L. It was used by Southern Pacific and was numbered SPMW 5594.
It was donated by Kerry Cochran to the museum in 2012.