I think this has to do with privatization. If trains were run by the government (sure, less efficient but also no need to feed greedy shareholders), it would be much cheaper.
Ironically it’s other way around. The reason why flights are so cheap is because they are privatized and there is heavy competition. US used to have heavily-regulated air travel. Once it was de-regulated prices went down.
Since railroads require very expansive infrastructure, have natural competition limitations (two companies can’t send two trains on the same path at the same time), they are heavily regulated, and as such there is less competition, and thus no invisible hand of the market helping to lower the prices.
Whilst there might be some gains from bringing everything under one roof, cutting out the need for shareholder returns isn't going to do much for the average ticket price - IIRC most train companies in the U.K. have long-run profit margins of 2-3%.
In denmark trains are run by the government, but its still cheaper (at least pre-covid, dont know at the moment) to take a plane from Copenhagen to Århus (capital to next biggest city).