Some countries (China is the most notable example) have security checks prior to boarding a train comparable to flying.
In Poland, if you buy your ticket for an Intercity train online, the conductor will ask for your ID to ensure the names match. The state, or perhaps just the operator, seems to be concerned about who is paying and traveling in this case. One can still buy tickets with cash, though.
You're right that China has security checks for trains but I don't consider them comparable to flying. The train security checks are much faster. I've rarely had to wait more than 5 minutes in line. You don't have to take off your shoes, don't have to take out laptops and things from your luggage, and drinks and liquids are generally allowed. I've only on a couple occasions been asked by security in China to take a sip of an already-opened drink or reusable water bottle to prove that it's a drink.
The more annoying thing about rail in China is that many of the newer high speed rail stations are being built slightly outside of cities, and it often takes an extra hour to get to the station. Most of Europe's train stations are smack in the middle of downtown.
The shoe thing is an American peculiarity. In Europe I never had to take off my shoes, even when I flew to the US. And now some airports (eg LCY) don’t even require taking liquids and laptops out of the luggage.
In Beijing when flying to the US they confiscated water that I had bought post-security. There were people on the actual boarding ramp confiscating liquids. Wasn't good for me because my body needs to frequently drink water, I get dehydrated easily.
It didn't happen when flying to domestic destinations in China, so it makes me think the US requested that to happen.
Better bring a sack of fruit with high water content then. Maybe the security doesn't have enough imagination to clasify them as "liquids". For instance China is an exporter of pomelo. The fruit is also used as a good luck charm, consumed during the mid-autumn festival and used in Ganesh Chaturthi celebrations in India, so you could claim it's for "religious use" if they try to confiscate it.
You can peel it without a knife. A bamboo knife is a lot more useful than plastic crap. Or get a Revolut Metal card. Perfect for opening pomelos, also perfectly acceptable for travel.
Every time I'm in Barcelona or Frankfurt airport, they tell me to take off shoes. So I'm pretty sure this also applies to Europe, albeit not at every airport, and not even every time at BCN airport I've had to do so. Maybe depends on the people working the shift?
And no liquid restrictions. They have special trays for the x-ray machines so you can bring in your coffee without spilling. And you can come back from France with a box of 12 wine bottles no problem.
The UK ditched airport liquid restrictions in December 2022 (although airports have until June 2024 to implement the change). Specifically, the 100ml rule is now a 2 litre rule.
Generally speaking you don’t have to remove shoes at UK airports, either.
I find it interesting that LeShuttle (the same tunnel between France and UK, but where you drive your car onto the train) does not. They barely do any security checks on cars, and only seem to glance briefly at passports.
They say that they check ID, but I've traveled dozens of times in coach and business (both with single-use tickets and 10-ride passes) and a handful of times in a sleeper, and I've never been IDed once.
In Poland, if you buy your ticket for an Intercity train online, the conductor will ask for your ID to ensure the names match. The state, or perhaps just the operator, seems to be concerned about who is paying and traveling in this case. One can still buy tickets with cash, though.