One of the main reasons for the disparity is the lower taxes that the aviation industry benefits from.
If you fly from Paris to Barcelona the airline not only pays no VAT, but is also exempt from kerosene tax. If you make the same journey by train, the rail company will pay an energy tax and passenger VAT. This means higher costs for the company which are usually reflected in ticket prices.
Archived version: https://archive.ph/7Zrur
Maybe the cost of building hundred of thousands of kilometers of tracks has to be financed somehow?
I think the point is that the governments should be subsidizing rail costs to encourage train travel over flights, if they want to fight climate change. So yes, it’s expensive, but maybe money well spent.
And the tracks serve multiple purposes. It’s the same track running local commuter services, intercity sleepers, and freight.
Roads have no big problem being financed though