Tickets are named and have a record of your ID number (national ID card or, for foreigners, passport). On the train, the ticket inspector checks that the details match, and that your face matches that on the ID document.
This doesn't apply to metro services (like the Beijing subway or the Beijing airport express that you mention).
Geezus. Russia used to have internal passports/travel permits, this smells like something similar but implemented through the rail network, it wouldn't be hard to implement a "house arrest" by disallowing ticket sales to some people.
I guess they can still hop in a car to travel. Requiring ID also makes surveillance of people's movements, although I guess monitoring your SIM card is more effective.
Only trains I've taken in China is to/from Beijing airport, and the metro