These days, LEGO train layouts can be operated fully automatically like in the traditional model world. The most important objects on the layout are electrified and automated switches.
I explain in this video how to automate standard switches, triple switches and double slip switches using switches from Trixbrix as a an example.
All infos regarding LEGO train automation can be found here: https://mattzobricks.com.
Specific infos to automate switches can be found here: https://mattzobricks.com/build/switches
Enjoy!