To fix the wiring on a model train, set up the train and transformer, plug in the transformer, slowly activate the train, listen for buzzing noises to determine if the transformer works or there are other wiring issues, and then unplug the transformer. Ensure you're properly grounded in case of shock. Undo the screws to open the case that houses the transformer, find the capacitor, and discharge the stored voltage with a screwdriver.
Look carefully at all of the wiring to search for loose connections, fraying or oxidization. Clean all broken wires, and use a soldering iron to reconnect the wires to the right terminals. If a wire is oxidized, use the soldering iron on it to remove the original solder. Dip the wires in an oxidation remover, and only remove the wire from the remover once the affected area is clear of oxidization. Ensure the wire is dry, and use the soldering iron to replace it.
Replace loose connections, and check for additional wiring issues. Once the wires are fixed and replaced, place the transformer back in the case, securing it with the original screws. Connect the transformer to the track, and plug it in again to test it. If the train moves, the wire repairs worked. If there is no movement or activity, the transformer probably needs to be replaced, or one of the wires isn't properly connected.