A lot of people were requesting this... just after I wiped my PC

. So I installed GMod again and made you a tutorial.
I will only explain how to read the colour codes in the map, I will not explain how to code it so it follows a route or any shit like that.
1. Make a simple train. Easy enough eh?

2. Select the
Wire tab, scroll down to
Wire - Detection and select
Ranger. Make sure the only tickbox checked is
Output Color:
3. Attach that to the front of your train (I've turned the beam on so you know where it's pointing). You can have it pointing in pretty much any direction as long as in the end it'll still hit the button, I prefer to put it on an angle though, gives it more time to switch.

4. If you look at what the output of the colour is you'll see that it says 12,1,0,255.

First off you can ignore the end value, it's an alpha value which hasn't got a use, so we now have 12,1,0.
12,
1,
0 corresponds to an RGB value (Red, Green, Blue

).
5. Lets take a looky at this intersection cutout from
THIS MAP
Looks confusing doesn't it? Ok, let's simplify it.

All we need from this is the yellow dot and the number 12. The yellow dot represents the button position to trigger the specific intersection and the number 12 is the
Red value. But what about the green value on the image you say, well this is for button 10 on the map, so let's go back to the complex image to take a look at it.

Even though this track section will never disconnect from the track it still has to have an on and an off value, this is the value which the green value will be on depending on which direction the track is travelling in. If you look at button 12 again you'll see that this section will disconnect from the track when it's switched, so when it's disconnected from the track the green value will be off (0) and when it's connected it will be on (1).
Stations are pretty much the same too, just they use a blue value (Shown with the blue text just incase you've not realised yet

)
I really hope this has made it clearer for you.