I know Vigilantes are just itching to shoot the revealed mayor, so here's the only time it is genuinely beneficial to do it.
Other Town of Salem Guides:
Killing the Mayor as Vigilante
You're the Vigilante in a game where the only evil role left is a Witch. There's a revealed Mayor and you desperately need to win before the game ends in a tie. This is the very specific and stupidly unlikely situation where this guide comes in handy. What do you do? Well of course, shoot the revealed Mayor.
At first the town may react negatively, calling you a gamethrowing flummery stupid vig. Soon, however, they will realize that you made the right move. The only reason the Witch is still in this game is because you're alive. As soon as there are no more killing roles left alive, the Witch loses. Rather than find the Witch, just kill yourself. You could ask the town to lynch you, but that may come off as an attempt to win as Jester and may backfire on you. You could shoot at random, but if you hit a neutral role like Jester or Executioner it could waste one of your bullets, or you could hit someone with defence/being healed. The Mayor cannot be healed by Doctor, has no defence, and is 100% guaranteed not to be a neutral role. That means that in this situation, killing the Mayor is your best bet. Have fun killing your revealed Mayors :-)