I suspect it just boils down to minimising the number tasks staff are responsible for, so you can reduce the number of staff needed. Aircraft need to have attendants for safety reasons, and the minimum number of attendants is dictated by the number of passengers. Most of the time airplanes aren’t in emergency situations, so you’re got lots of spare staff aboard, and you can use them to look after toilets and feed passengers.
Trains on the other don’t have such minimum staffing requirements and usually operate with only one or two staff total (driver plus maybe a ticket inspector). Train operators want to keep staff on train to an absolute minimum (people cost money after all), but those staff still have some safety responsibilities which can’t be removed. Instead you try to remove every other responsibility they might have, such as dealing with toilets.
Automated toilets means the toilets themselves can be responsible for the vast majority of their operations, and can be trusted to fail safe if something unexpected happens. Meaning there’s no need for staff to perform regular inspections while the train is in service, and no need to worry about something going silently wrong and hurting someone. Instead the toilets can ensure that unsafe situations don’t happen, and proactively alert staff if something unsafe does happen.
An old fashioned handle and lock is about as low maintenance as you can get - far less than a complex locking mechanism requiring a computer reboot from the cab to handle when a passenger gets stuck in because they can’t figure out the “open” butto