Here's a couple of simple electronic designs for your railroad that can easily be built with little more knowledge than how to solder.
Automatic train-stop
Train detection using photodiodes
I designed these a couple of years ago, and some of you might notice that they involve many of...