I've had this happen to me when I was working at the local airport and I was riding my motorbike to work. The damn traffic lights I got stuck at had those light sensors on them to detect when a car pulled up and would automatically switch the lights to green (side road entering onto a dual lane urban carriageway) - because I was on a motorbike, it wouldn't/couldn't detect my headlamp and so I couldn't get the lights to switch. I ended up having to turn back up the road and ride towards the traffic lights a few times with the headlamp on full beam and it still didn't work. In total, I reckon I was stuck there for about 10 minutes, before deciding to sod it and go through the red light, only for a car to go past as I was pulling through the lights! Just my bloody luck!!
I think in such a situation the traffic lights can be deemed faulty and you can pass through with care if they are stuck on red. It is the same when riding a bicycle, the induction loops in the road don't always detect bicycles so when cycling at night with little traffic around, I have (in the past) been stuck at a red light that won't change, so I either go through carefully or dismount and walk on the pavement (if available). It is not reasonable to expect people to set up base camp for the night until such time that a car comes along to trigger the lights. You can report the defective lights to the appropriate authority which I have done in the past with some success.
It may be theoretically that what you are supposed to do is contact the police and wait for them to either deactivate the lights or manually direct traffic, but if I ever get prosecuted for going through a red light with care after establishing they are stuck on red, I will be happy to defend myself in court.
