That’s actually the market working as intended. In the case of flights you have competition which drives the price down, in the case of trains you mostly have a monopoly of the national operator which increases prices each year (DB, Germany). Train prices are prohibitively high, and when I face the choice I always end up driving vs taking the train (the price advantage grows larger with the number of people travelling).