I have always been fascinated by the the more unusual railroad equipment of the latter 19th and early 20th centuries. This inspection engine is one of that genre, used not only by inspectors but by railroad dignitaries. One would assume that inspections could be done quite well and in greater comfort by using a private car behind an engine, but a benefit may be the high elevation afforded by perching the car atop the engine - even higher than a typical engineer's cab position. Surely, since such an engine would not ordinarily be used for anything other than the purpose for which it was designed, it was also something of a luxury – a bit of company arrogance.
Whoever rode in this affair would want to have a degree of faith in the operators since they were literally riding on the most volatile part of any steam engine – I have a few images of what an exploded steam engine looks like after such a mishap (I'll post a couple of them soon)!
The canvas tents in the background of this 4-6-0 engine seem to suggest that this was part of a display, perhaps the 1876 Centennial celebrations, an exposition or industrial exhibition of some kind. Since these engines are not newly painted and spiffed up, it may be equipment currently in use by the railroad, but they could be on historical display if this image is early 20th c. (I am not aware of any inspection engines that have survived as part of transportation museums and I have never seen them except in photos and illustrations).
Unlike the Galloping Goose and other self-propelled railroad equipment, the inspection engine is not popular enough among model railroad fans for them to be available for purchase; I built a scratchbuilt running model in the late 1970s for my own edification.