People pay big money to go for long train rides, and the aura and advertising associated with the "Great Train Journeys of the World" is very prominent. Both the Ghan and the Indian Pacific make money from passenger traffic.
These trips are advertised as "premium" tourism events, and the passengers pay high prices for premium accommodation, premium food and dining experiences, and associated events in towns that the lines pass through.
A company named Journey Beyond runs these train trips and the whole operation is quite highly profitable.