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.
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.
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).