I just love long rail trips, often do Switzerland-Tunis via Palermo to see my in law family. Best trip ever was Tbilisi-Zurich via Batumi, ferry to Odessa Kyiv and Vienna.
In practice, those are two different types of train travel. The former exists only in countries with a rail heritage. Where countries are genuinely trying to replace air travel with high-speed rail (credit to them, it's much more sustainable), the new train stations are alas a bit like airports for trains. You generally can't just turn up and hop on. In China you can't even get into the train station without a booking.
China requires showing identification to buy a long-distance train ticket.
Other countries I'm familiar with (Spain, France, Germany, UK, Japan) certainly do let you turn up, buy a ticket, and get on. It will cost more than buying earlier.
>China requires showing identification to buy a long-distance train ticket.
In China, ID and ticket are the same thing. You know that already.
Europe and Japan (what I meant by "rail heritage") are indeed more relaxed. But even in Europe the newest high-speed network, Spain's, follows the airport template, with security check and departure lounge. You have to turn up 25 minutes ahead of departure. It's such a shame and so self-defeating.
I wish to see high speed maglev transportation to supplant air travel in my lifetime.