This is a simple idea, an event that you set on the trains spawn, you could set it to do something like move 200 bricks, wait 10 seconds, go back 200 bricks and wait 10 seconds.
With this repeating you could have a simple train system working on your build, rp or anything that a train is needed.