Steam engines literally led to the development of electric motors. Steam engines led to steam turbines which led to dynamos which led to electric motors, each invention building off the knowledge gained at the previous step.
https://en.wikipedia.org/wiki/Steam_turbine https://en.wikipedia.org/wiki/Charles_Algernon_Parsons https://en.wikipedia.org/wiki/Dynamo
Your analogy is doubly flawed. Each type of engine you mention has strengths and weaknesses that depend on external variables. Internal combustion isn't better at producing electricity for instance, which is why we mostly use external combustion to do that. Electric motors aren't better than internal combustion, except that internal combustion is causing climate change. It's also flawed because history has shown that Socialism doesn't work better than Capitalism. I could see, if this were purely theoretical, someone arguing the benefits of Marxist ideas, but it's been tried. In several places around the world, people tried to put in place the kind of changes you're advocating. In every case it led to authoritarianism, brutal repression, and starvation. Does it suck that poor kids don't have enough to eat, while Bezos builds space yachts? Yeah it sucks, but it's not millions-starving-to-death levels of suck like we actually, not theoretically, got every time we tried Communism or Socialism or any kind of take-their-stuff-and-give-it-to-me-ism.