In the event notice of a contest is filed as provided in the previous section, the mayor and councilmembers of the city then in office shall continue to perform their duties as such officers until the contest is settled and determined and until their successors are legally elected and qualified.