i think that the solution is somehow dependent that there is an uneven number of them they should agree on an initial position of the switches, which the 1st prisoner will make, say A and B switched off. discovering this position, the next prisoner changes this to A and B are on. if anybody visits the switch room second, third etc time, he doesn't touch anything... or even more complicated plan
A B
1. off off
2. on off
3. off on
.....

don't ask me will it work or not. this is the end of the day. i am capable of inventing an insane plane but not seeing its consequences