I found a easy way to stop AI Trains form wondering down other tracks besides the main line this is a quick fix for that problem ( I know most of you already know but for thows who don't or are new to trainz this will help )
I use a Track Direction marker to block off all routes but the main line, it will stop the AI form going on that line and if you want it to then you have to move the AI past the blocked track. I do this for passing sideings and spars.

I use a Track Direction marker to block off all routes but the main line, it will stop the AI form going on that line and if you want it to then you have to move the AI past the blocked track. I do this for passing sideings and spars.