Train toilets have become complex systems since the days of there just being basically a hole the floor. This is due to many factors such as not having to prevent people from using them when at a station or people getting hit by sewage in the country side when a train passes. Additionally the toilets need to be accessible and environmental friendly nowadays.
Sadly all of this adds complexity and more possibilities for failure.
In Switzerland we have bioreactors [1] in newer trains which are like a mini sewage treatment plants. These are still very new and still have bugs that are being worked out such as how much oxygen needs to be provided etc. Until recently it caused a bad smell at the main station which is ironic since that is what we used to have in the 80s with the old dumb toilets.
[1] https://news.sbb.ch/artikel/114447/unangenehmer-geruch-aus-b... (German)