For everything there's a prototype - even for an electrically heated steam engine!
During WW II Switzerland had a shortage of available coal, but abundance of hydroelectric power. Since many (today 99%) of the swiss railroad lines are with overhead wire, a few steam engines had been converted to electrical heating.
Lukas Rosenthaler, Basel, Switzerland