Usage patterns
〈人〉が市長に当選するfor someone to be elected mayor
He was elected mayor in last month's election.
市長に立候補するto run as a candidate for mayor
She plans to run for mayor in the next election.
市長を務めるto serve as mayor
He served as mayor for ten years.
市長に就任するto take office as mayor
The new mayor will take office next month.
市長を辞任するto resign from the position of mayor
He resigned as mayor after the scandal.