>>233487That was in Britain where they were forced to burn soft bituminous coal which puts out more smoke, and that pertains more to the early models from the 19th century. By the 20th century, cleaner anthracite coal was available worldwide and cut down on smoke levels, and increased efficiency of the engines. Also bear in mind that steam engines don't have to be coal-fired. Anything that burns, it'll take: coal, diesel, kerosene(OP pic related), natural gas, wood, charcoal, and even biomass like peat or animal dung. I doubt anyone's checked to see how the Flying Scotsman would smell if it burned the latter, though.
Further strides were made with better insulated and ventilated cabins that kept the drivers and firemen safer and cooler; heat going into the cab is heat not going into the boiler, and thus money wasted, so safety aside they don't want to lose heat to the cab. Yes, yard workers lost their hands in the early days, but that coupling system has been ditched for 130 years now, and you only see them in museums. Current systems use safer mechanisms for couplers.
Diesel's okay for now, but the world will run out of oil one day, and entire fleets of diesel engines will be useless, since biofuels can only at most handle 10% of the road vehicle demand for diesel anyways. Nuclear power is safe when fixed to the ground, but put it on wheels and it's just as dangerous as having Little Boy armed and sitting on a flatbed going 60MPH through a city. The weight and size considerations of the necessary safety barriers is just too much for rail. Electric is only worth it if more than 10 trains a day pass through the given electrified track. It costs a great deal to have the electricity going through the pantograph wires on a daily basis, and in many instances, it's not cost-effective. Steam still has its perks, so don't be so quick to knock it.