You could look into DarkAI. It talks about "pathfinding". I never tried this before, but you could probably designate a path by creating two hidden walls (could be any shape as long as they are on each side of the path you want) and placing the train model between them. The AI "pathfinding command(s)" should then go from point A to point B, while staying within the walls. If you create a looped track and set point B = A, the train should (in theory)should follow the loop. If you want the train to repeatedly circle the loop then the pseudocode might look something like this:
A As Integer `This is the starting point and may have to be a vector instead
B As Integer `This is the end point and might also have to be a vector
A = AI Pathstart
B = AI Pathend
Do
Repeat
MoveTrain() `The MoveTrain() function would contain the DarkAI commands
Until
B = A
Sync
Loop
Good Luck. Let us know how it turns out