what if a trans person genuinely feels uncomfortable sharing with a man, a strange man at that? Demand their own berth, or hope another trans woman is on the same journey?
Yes, I think this would be difficult for any trans person who didn't want to go through an awkward discussion with the person sharing his/her berth. Given that trans people are a small part of the population, the fairest thing might be to let any trans person have a single compartment (at the standard, not first class price) if they are uncomfortable sharing with someone of their biological sex. Yes, a few people might try it on, to blag a private compartment, but at least no one's safety or dignity would be at risk.
I'm totally opposed to women having to share with men, however they identify, but it's also important to find a way for trans people to use the service. Rupert Soames' suggestion of women having to tell the guard if they're unhappy sharing with a TW would be awful for everyone - the woman, the guard and the TW.