Many Intercity rail lines- both historic and high speed- should be profitable including infrastructure maitenence- but they might not be profitable enough to pay for improvements.
For high-Speed trains that discounts the initial, enormous investment. There is no doubt that the initial French LGV paid their cost and probably also could pay (via track-access charges) their further improvement, but I have my doubts that the newer once, some of them like LGV Rhin-Rhone not very intensively used manage that, at least not in a relevant timeframe. Put in a long tunnel, like Bologna - Firenze, and it becomes even more difficult. And than you have many HSL, probably most recent Spanish ones, which will probably never achieve it.
Also, at least in Europe, it is a matter of country specific policy. France puts their access-charges sky-high to recoup investment, others prefer to keep them lower to encourage higher usage.