It really shouldn’t be that difficult.
Either the traffic lights have a mechanical timer (very old school) or they have an integrated circuit that acts as the controller. In either case something in the controller box sends an impulse down the circuit to cause the color to change.
What you need to do is to trace which wire it is that is sending that signal, and then tapping into it. (Note – a digital controller will be far more complicated than an analog controller).
You have to keep three things in mind, however:
1) timing: there is likely to be a time delay of several seconds between the time the controller sets to GREEN and the light actually changes. And it will take the spikes a second or two to retract. So you have to build in some sort of anticipator to pre-lower the spikes – otherwise people will start driving when they see the green, even if the spikes have not retracted.
2) emergency vehicles: how will you deal with the need of ambulances and fire trucks, that frequently run red lights to get to their destination? Similarly, how will you deal with the occasions where police are directing traffic (perhaps due to an accident nearby) and are not heeding the traffic signals?
3) people who run red lights – will you by definition puncture the tire of anyone who runs a red light? Bad idea.
I think this is an idea that technologically can be achieved – but you have to deal with other situations.
And in the US at least, there would be huge legal and regulatory hurdles.