The Mayor is a role IN ADDITION to another role. The Mayor may be either on the Villager team or the Werewolf team, depending on their other role.
The Mayor will know the Magic Word, but be unable to speak for the duration of the game, and can only communicate via tokens as responses to yes/no questions.
If the Mayor is on the Villager team, they want to help the players correctly guess the Magic Word. If the player's other role is the Fortune Teller or Seer, when selecting a Magic Word, they will be given an easier choice of words to pick from.
If the Mayor is on the Werewolf team, they do not want the players to guess the Magic Word. They are permitted to mislead or even lie to players when giving tokens to lead them away from the correct answer.