I added qty 4 capacitors (47uF, 35V) which are about 10 cents each. So that's added to your 12v 4-channel relay board which I see is just over $3. You apparently already have a 12V DC wall-wart.
This example uses 4-relays of an 8-relay 12V board as that's what I had handy. As Leo suggests you need 2 adjacent insulated sections to get bi-directional behavior.
I cut some insulated sections into a piece of track and attached the two orange wires as the triggers to the circuit. The small white prototyping board holds a two pairs of Red/Green LEDs and resistors. It's kind of hard to see the green LEDs but they are right above the red ones. And here it is in action.
The "privacy screen" is simply to block the distracting LEDs on the relay board; there's a red power LED that's always on, and a red LED for each relay which turns on when active.
So with no train present, both heads are green. Coming from one direction, one of the signal heads turns red and stays red until the train exits both sections. Coming from the other direction, the other signal head turns red and stays red until the train exits both sections.
Sorry, but I gave up trying to get my head around north-bound, south-bound, what's prototypical, what's just-for-fun, etc. I made something which I thought was interesting. Take it or leave it!
If you want to know exactly how to wire THIS SPECIFIC implementation I will draw it up based on the 4-channel relay board shown above. The basic idea is as follows. Each signal head needs an SPDT or 2-output relay to drive red or green. To perform bi-directional behavior you need a 2nd relay for that signal head to act as a "lockout" to disable the red/green toggling from occurring if the train entered from the other side. That's why there are 4 relays for two signal heads rather than just 2.