It should be obvious that when the machines are in phase there's no voltage across the lamps and they all 3 go out,
so it's safe to close the switch when the lamps are out
whenever the machines are not in phase there will be voltage across the lamps
e.g.
at any instant the voltage across a lamp will be the difference (vertical distance) between red and blue voltages
and as phase shifts between 0 and 360 degrees, that voltage difference will grow from zero to twice peak than back to zero
so your synch module must either :
use lamps rated for twice voltage,
or do what we did in the power plant - two lamps in series.
Used to be in Great Britain they preferred to wire their lamps through transformers and swap phase so that the proper time to close the switch was maximum brightness instead of minimum. Sophie might know if that's still the practice.
The lamps also tell you if there's a voltage mismatch - the they'll never quite go out.