I've used these in cars for HO passenger LED lights, really small so they fit.
MP1584EN DC-DC Buck Converter Adjustable Power Step Down Module Converter
I used a coin battery, holder and on-off switch placed in the doorway window area. I did these this way because the wheel sets were all plastic.
For AC 3-rail use, add a 220uf 25v capacitor and a KBP206 2A 600V generic diode bridge rectifier.
I've got some good Williams engines (E-7) and passenger cars that I'm going to do this to, because my longest set pulls about 5 amps