The dialog infers he was Governor before the famine. The famine is why and how he seized total power and declared martial law
.COMPUTER: Working. Kodos the Executioner, summary. Governor of Tarsus Four twenty Earth years ago. Invoked martial law
It's unlikely the the computer and Spock would refer to him as Governor if he was some guy off a transport who declared himself Dictator. It has to be a position given him by Earth, the Federation or the Colonists.SPOCK: I will continue, Doctor. According to our library banks, it started on the Earth colony of Tarsus Four, when the food supply was attacked by an exotic fungus and largely destroyed. There were over eight thousand colonists and virtually no food. And that was when Governor Kodos seized full power and declared emergency martial law.