These look vintage so no circuit boards. A 154C contactor is needed to create the flashing effect. If you look at this site, https://www.tandem-associates....l_trains_154_acc.htm, youll notice the contactor is split so when the wheels ride over it, they create the on off flash effect at the lights.
You can simply put some power to the posts temporarily to see if the lights work. If not, a squirt of WD40 to the socket might free them up to remove and replace. I forget if they screw in or are a push in and slightly twist design to pop them out.