That is the exact context - obeying the law. The theme of the entire chapter is the Christian duty to obey the law and consequences for not doing so. Paul is saying God establishes governments and they do not wield the sword for nothing. We know what punishment a sword is used for.
Perhaps I misunderstood your intent in the first post. We’re you suggesting that if the government’s laws specifiy death as a penalty then that is legit?