If you are absolutely sure you have a train that requires DC, your idea seems sound. Do you know the make/model of the train itself? (or have a picture of it?) That can help determine if you really need DC or if AC will safely power your train.
As to the switch, take a look at the schematic here. (random example, the fact that the linked article is about motors for window shades doesn't matter, the circuit will work the same for a power supply to track polarity switching )
In that image, "power supply" is the output of your transformer after it's been through the rectifier to convert the AC to DC. "Motor" is the connection to the track.
-Dave