A diesel locomotive is a fairly efficient electricity generator.
Compared to what?
It could well be that the saving by using shore based power ws so small it was not worthwhile.
With Amtrak routinely trumpeting their "green" image it's odd to see them running parked locomotives simply because being less wasteful wasn't "worthwhile" enough for them to bother with. Here in San Antonio they plug in the ground based HEP but still leave the Texas Eagle locomotives running all night long anyway. That's around eight hours each night or almost 250 hours a month, or nearly 3,000 hours each year. Or a minimum of 60,000 hours during the lifespan of a locomotive. I wonder how many gallons of diesel it takes to keep a locomotive running for 60,000 hours or more. Oh well at least petroleum is still cheap right.
By the time you consider line losses between power plant and user using oil or gas to power a central generating plant, I would suspect that it would prove ridiculous.
To a man with only a hammer, every problem resembles a nail. To a railroad with nothing but diesel electric locomotives every problem just needs more diesel thrown at it. Which is fine when petroleum is cheap. When it becomes more expensive there's no easy way to mitigate the costs. Which is why rail shipment invoices now come with perpetual fuel surcharges.
Most people agree that nuclear is cheaper than coal or oil.
Cheap nuclear sounds great until you start researching the issue. Last I checked here in the US nothing is cheaper than using coal when deployed nationwide. If you add up the full costs of designing, building, fueling, maintaining, and decommissioning nuclear power plants, including the costs and liabilities born by the US taxpayer, the cost of nuclear is in reality surprisingly high. Modern nuclear power plants can easily reach tens of billions of dollars just to license and build. Not to mention that the fuel still needs to be mined, transported thousands of miles via specialized shipping, heavily refined and processed, constantly protected, carefully loaded, constantly monitored, even more carefully removed, slowly cooled in specialized pools, sealed in specialized caskets, transported thousands of additional miles to be stored away from natural resources, prying eyes, and terrorists for anywhere from thousands to millions of years.
So far as I can tell the myth of cheap nuclear comes from a unique sequence of events whereby the original builders of the nuclear plants eventually succumbed to the debts incurred in building and maintaining their own plants. Other companies that did not build and were not liable for the debts were able to come in and buy the plants for pennies on the dollar. Thanks to agreements already in place from as early as the 1950's the US taxpayer remained on the hook for much of the legal liability and storage costs from plants built prior to the 1980's. As a result the new plant owners were able to leverage this rather unique situation into a great money making business. Unfortunately it only works for the middlemen. The original owners who built the plants got burned, just like the US taxpayer will eventually get burned as the first bills for decommissioning hundreds of plants and their fule for millions of years of highly secure storage must be paid. Good luck when that day comes.