So now you switched from "the guy who (used to) take your ID on a cross-border night train might have been an imposter" to "when I am on a train I am not constantly under survellaince by a controller".
Your fantasy scenario conveniently omits the part where on a night train where you have booked a special compartment with beds and you are crossing borders you can put up a uniform, access the locked wagon-lits cars of the trains, get my passport, get back to the rest of the train, change back, drop off at the next station.
(Hint: the cars with bed compartments are separated by the ones with seats, you access these by showing the tickets to the same uniformed guy who would get your passports and wake you up later, and also night trains do not stop anywhere for hours - stops at the border are as short as possible, and passengers are not allowed to leave the train: for wagon lits the controller will take care of the passports, while people in the normal cars will be checked by the police)
The whole point of taking your passports at the start is to save you being wakened by the border police, so you can sleep for the whole trip.
And for the same reason, wagon lits are locked so that regular passengers cannot get there and disturb you, or try to evade police at the border.
A uniform
Special tools to check the tickets and operate locks
An ID
I don't know where you live but the idea that people would impersonate a conductor(1) to get your passports is something out of a James Bond movie.
1) they would also need to incapacitate the real conductor(s) beforehand.