I'm mildly surprised that this isn't covered by legislation, either from a healthy & safety perspective or as an interpretation of the Equality Act. Allowing a service to run for over a given length of time without operating toilets, or some other provision, would sound to me like indirect discrimination against people with disabilities, and potentially (though maybe a weaker case) against women too based on the extra needs that women have during periods. Requiring disabled people to delay their journey probably would class as discrimination, particularly on services which operate infrequently.
Of course, I also recognise the problem: we'd all rather a service run without toilets, than be cancelled. The obvious compromise is to mandate that in the event of a service running without toilets for more than a given length of time (90 minutes? 2 hours?), there must be a toilet stop at a station with sufficient facilities included.
Maybe my reading of the Equality Act is wrong here - it all depends what's counted as a "reasonable" adjustment - but I think that there'd be a case to be made against a TOC in circumstances where services run without toilets, and to take the next service would result in an unreasonable delay.