Hi Robsmorgan,
That vehicle is actually a paycar, that went round the railroad with all the wages - the small window is where the employees received the cash. The photo is of its later years with the 'San Joaquin Valley RR'. Originally built for the Napa Valley RR is was quite powerful and could haul 18 freight cars of the day; and with eight was capable of quite a speed. It was built by the Vulcan Iron Works of San Francisco.
There is a nice line drawing view of it in John Whites book 'The American Railroad Passenger car', Vol 2. P582 which does show a very similar vehicle with a (70 foot long) coach behind the loco, and also other vehicles of the same basic design. Steam powered cars were built up to 1936 and there were some very large and powerful ones built.
By then gasoline engines (it is an American topic ) were gaining reliability so began to take over , with some of them having the engine driving a generator - hence the gas-electric. Others were chain drive like the original HGV's: some of these used Mack Engines with their trademark 'coal scuttle' bonnet.
The narrow gauge also used them - with the very well known Galloping Goose vehicles of the Rio Grande Southern and other smaller (narrow gauge) vehicles were built and used as well.
Here in the UK there were some built The Midland Railwway made a pair of matched vehicle that George Dow bought much later when the railway had finished with them for his own private saloon, which he had in Wales I believe. Somewhere (the NRM?) it is still in existence. The LNWR, GNR, TVR, LBSCR, LSWR, and the GNSR, and I am sure other railways had some, and of course the newly restored GWR version are other railways that used them. The 'Achilles heel' for them was when passenger numbers rose they were not powerful enough generally to take trailers.