My father in law loves modifying his model trains and was looking for a way to add interior lighting. I had some spare LED strips, which are also 12 Volt, just like his train tracks.
The issue we ran into however, was of course, that the LED wouldn't turn on if the power is reversed to make the trains go in the opposite direction.
I was thinking of a solution using 4 diodes to create a rectifier and then found the Diotec S250K, a bridge rectifier.
The S250K fits quite nicely on LED strips. Now the trains have their lights on in either direction.