The conductor took your passports for the cross-border check, since you'd likely be soundly asleep at the time when it would happen. You can view this as a service.
That happened to me years ago when I took an overnight train from Paris to Zurich. Problem was I didn't speak French and I didn't understand why he took my passport. Because I didn't know when I would get it back (eventually I did many hours later a few minutes before my final stop), I didn't sleep at all that night because I was worried about not getting it back. Wish I had done a little more research beforehand (and spoke French!).
For a train that crosses country borders it can be an issue, if someone hops off the train before arriving to the final station (and having their visa and luggage checked there). Apparently that is not a problem in the US or EU.
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.