Appoint a mayor high in politics attribute, who will be mayor almost all of the time. This gives you yje greatest resource building power.
When troop training, appoint as mayor a hero high in attack attribute. Once training commenced, reappoint your politics no need to wait for training to complete). This increases training speed.
When research in your academy or workshop, appoint as mayor a hero high in intelligence attribute. Once research has been commenced, reappoint your politics hero (no need to wait for research to complete).
When under attack, whichever hero is at your city (actually there, not out on an attack etc) will defend it, whether mayor or idle. So don't worry about changing your mayor when under attack.
When troop training, appoint as mayor a hero high in attack attribute. Once training commenced, reappoint your politics no need to wait for training to complete). This increases training speed.
When research in your academy or workshop, appoint as mayor a hero high in intelligence attribute. Once research has been commenced, reappoint your politics hero (no need to wait for research to complete).
When under attack, whichever hero is at your city (actually there, not out on an attack etc) will defend it, whether mayor or idle. So don't worry about changing your mayor when under attack.