A somewhat significantly sized city is faced with a problem. It currently wants to reduce the smoke from the steam locomotives in the city & build more efficient & compact stations, however it doesn't have the money to electrify it's entire network. Diesels aren't that well established for anything yet in the region at a large scale & there have been bad prior experiences with diesel in the city so a bi-modal diesel isn't really considered in the first place.
So the question becomes how to make a locomotive capable of operating on both a coal or oil boiler or electricity. People have fiddled around with steam-turbine electric locomotives in this world & found out what we did in the real world about them (heavy, complicated, unreliable & expensive) so that isn't considered a viable option.
The locomotives must be able to run even if only at a limited speed & power on electricity alone without burning coal while still being able to run as well as standard suburban steam engines.
the technology available is roughly that of the early 1950s, both 3rd rail electrification & overhead wire electrification are considered viable however 3rd rail is preferred due to other operators in the region also using it. (yes i know diesels were getting quite good in the early 1950s but they weren't very proliferated yet)
What is the best operating principle for an efficient steam electric locomotive under these conditions?