The problem with using analogue methods is that you can't tell what part of the cycle each microswitch is "up to", because the signal from the microswitch only changes at two points in the cycle.
A normal phase comparer circuit compares the phases of two sinewaves, which are continuous signals...