There's a simple solution to the problem with toilets on metro trains. You keep the toilets at stations open, and fund staffing to enable that. It has to be LOADS cheaper than putting them on trains, and having to service them.
If some stations don't have toilets, how about building some?
Yes, they're going to need extra attention at times but make it part of a franchise to provide such facilities and work out the best way to fund something I'd regard as very important, along with accessible platforms, passenger information, ticketing facilities etc.