The economics of trains are wrong and only make sense when fuel is expensive and fuel savings are worth investing in. That's a broken assumption long term.

Why is this important? Rail operates on the basis of an extremely high investment (rail) offset by the notion that you earn that back over decades / centuries via fuel savings. But rails has a high up front investment cost (many tons of steel, land disputes, decade+ of planning and construction), high maintenance cost (upkeep & maintenance). So, the fuel savings are really important.

With the mass deployment of electrical vehicles (cars, buses, trucks, ships, and soon small airplanes) that stops being feasible. Electricity is cheap and dropping in price and generally trending towards dirty cheap in roughly the time it will take to build a meaningful amount of new rail. Also, a lot of these vehicles will eventually become autonomous which knocks out a secondary source of cost: the driver.

That creates a formidable competitor to rail that can utilize roads, water ways, air ways, etc. and uses energy that is harvested at more or less constant cost from wind, geo thermal, solar, or nuclear.

That knocks the whole premise away under mass transit solutions that amortize the extreme cost of fuel (and drivers) by just moving a lot of stuff with one enormous vehicle (an airbus 380, a train carrying many tonnes of cargo or thousands of passengers, huge ships, etc.). These huge vehicles are only economical when the fuel savings matter. They won't.

What if you could route individual containers via light, self driving, battery electrical vehicles? Production cost of about 100-200K$ each, probably cheaper if you mass produce them. Good for a million mile+ operational life time. Can go anywhere you want it to go. Does about 1-2 miles per KWH at a cost of less than 0.005$/kwh depending on weight/size. The numbers are far better with people carriers because we are talking lighter, cheaper, and more efficient vehicles.

That's our future. Rail does not make sense in that future. If you have a train that transports 100 containers, we're talking 5$/kwh worth of electricity every mile or so. Electrical trains would have similar or a bit better fuel cost of course but be very expensive to build and operate due to the need for rails and heavy duty machinery on the rails. But it would be meaningless because electricity is so cheap. The vehicle purchase cost of hundreds of electrical trucks would be negligible compared to that and maintaining and constructing roads is also a lot cheaper. The fuel cost difference would no longer justify spending many billions on both infrastructure, vehicles, and maintenance for rails. No chance in hell to earn any of that back with fuel savings when the price of that drops through the floor.

Current prices for the most competitive solar bids are hovering around 0.012$/kwh. They are not going to stay there. 0.005 is only a very modest improvement. Long term we might be looking at 0.001 or even less. That's only 1 order of magnitude of improvement. It's the conservative scenario. Manufacturing cost is basically a function of how cheap it is to manufacture and install panels, storage, cables, etc. Ironically, a big factor in that cost are energy and labor. So, having cheaper ways to generate energy will make making cheap energy cheaper. Add robots to the mix and you drop the labor cost as well. Moving stuff around is going to be very cheap.