The module above will do the job.
For something smaller you could use a bridge rectifier, capacitor and an LM7805 voltage regulator. You will likely also need a heat sink on the regulator. Dropping from track voltage to 5 volts will make a lot of heat, which is why the buck converters are usually recommended instead of linear regulators, but in this case the size of the modules may be a deterrent. To cur down on the heat, if you are running a command system with constant voltage to the track, you could add a string of diodes in series to cut the input voltage to the regulator. each diode will drop about .6 volts. In addition, instead of a full wave rectifier, using a half wave will give you half the starting voltage.
Sorry if this is incoherent, I'll try to explain better if it turns out to be needed.