A viceroy is a monarch’s representative in a subject nation (e.g. the Governor General in Canada); he has similar but lesser powers to the sovereign.
In the metaphor of the conquered town, Reason is the ruler of the city, but cannot fight off the evil invader.
Likewise, Donne suggests that our reason serves a lesser but Godlike function in guiding and ruling us morally, logically, etc.