Train travel across long distances likely means sleeping in a compartment. Depending on the class you choose this may mean a compartment for two, four, six, eight or more bunk beds. I have sometimes been assigned compartments by gender, sometimes not. I have been placed with other foreigners and/or locals. The top bunk has added privacy but agility is a must and ample headroom for sitting up is not guaranteed. The lower bunk is the most accessible to all. And it may be the only place for those sleeping above to sit up straight, thus becoming the communal couch throughout the day.
Habits and routines need to be adjusted accordingly. But fortunately my experiences have all been with those who in the evening, regardless of age, nationality, or gender, were happy to sleep. Train travel, perhaps because of the swaying movements is notably soporific.
This short-lived communal living arrangement lends itself to courtesies of which I have seen few, if any, exceptions.