Steam engines never were very popular for short-range, in-yard movements, nor for extremely steep slopes and tricky bends: the Californian logging trains were an early example of a gas-powered (internal combustion engine) for locomotives on narrow gage logging rails even before 1900.
Never thought about flammables in moving with open-fired steam locomotives, but consider that barrel-on-top-of-barrrel loads were the first oil shipments, and sperm oil, kerosene, and the heavy crudes were dominant early on. These were not too flamable compared to today's volumes of refined products.
From Wikipedia - not a great scientific source, but sometimes useful;" A switcher or shunter (Great Britain: shunter; Australia: shunter or yard pilot; USA: switcher or switch engine, except Pennsylvania Railroad: shifter) is a small railroad locomotive intended not for moving trains over long distances but rather for assembling trains ready for a road locomotive to take over, disassembling a train that has been brought in, and generally moving railroad cars around – a process usually known as switching (UK: shunting). They do this in classification yards (Great Britain: marshalling yards). Switchers may also make short transfer runs and even be the only motive power on branch lines and switching and terminal railroads. The term can also be used to describe the workers operating these engines or engaged in directing shunting operations.
The typical switcher is optimised for its job, being relatively low-powered but with a high starting tractive effort for getting heavy cars rolling quickly. Switchers are geared to produce high torque but are restricted to low top speeds and have small diameter driving wheels. Switchers are rail analogs to tugboats."
That article also mentioned "Steam switch engines were also driven by accumulated steam from a central power plant." No mention of additional details. Electric powered and battery powered switchers were not common, but a few were built, most often for those railways that had no diesel or steam engines at all. (European electrified rails.).