>>1215077It's mostly because they're maintenance hogs. The N&W J Class was actually pretty good with automatic lubrication and such, and diesels took awhile to reach the reliability to replace them. Here's a video made in 1945 by N&W.
https://www.youtube.com/watch?v=9w48Bqq1JmEStill, there is one railroad in the US that still uses steam power for freight revenue service. Straussburg started running revenue freight again in the early 2010's and since they usually have several steam locos fired up and steaming for their excursions anyway, they use them to haul freight.