Sunday's vote is seen as a test of whether Thailand's cycle of coups, protests and court interventions can be broken.