You jest, but with an ESP32 flashed with ESPHome and a few dollars of electronics to regulate the power, I think controlling model trains would actually be quite doable. Your biggest challenge is probably dealing with network/scripting latency for events that need to happen in quick succession, like when dealing with switches.
Edit: there's also this https://github.com/aaron9589/esphome-for-model-railroading for the more serious model railroad enthusiast, though I'm not 100% sure if that actually controls the trains themselves (or just the switches and lights)
That's why I try as hard as I can to find either truly "dumb" devices with mechanical switches vs momentary buttons or devices that remember their last state after A/C power is restored. Hard to figure out the second option though without trying it unless a review happens to mention it specifically.
Awesome. The Home Assistant and related (ESPHome, Voice Assistant, Music Assistanc) communities are amazing and there is just a crazy amount of projects one can just pick up and use.
Or, if you consider Lego DUPLO trains to be model trains, there's this: https://community.home-assistant.io/t/lego-duplo-train-contr...
Edit: there's also this https://github.com/aaron9589/esphome-for-model-railroading for the more serious model railroad enthusiast, though I'm not 100% sure if that actually controls the trains themselves (or just the switches and lights)