Philippa Foot is most known for her invention of the Trolley Problem thought experiment in the 1960s. A lesser known variation of hers is as follows:
Suppose that a judge is faced with rioters demanding that a culprit be found for a certain crime. The rioters are threatening to take bloody revenge on a particular section of the community. The real culprit being unknown, the judge sees himself as able to prevent the bloodshed from the riots only by framing some innocent person and having them executed.
These are the only two options: execute an innocent person for a crime they did not commit, or let people riot in the streets knowing that people will die. If you were the judge, what would you do?
I guess there’s also a democratic argument here - the judicial branch is not accountable to the people directly but merely to the laws stemming from the people, so a deontological approach to upholding these laws is basically the basis of their democratic legitimacy. When they start making consequentialist or utilitarianist arguments it basically means they’re engaged in judicial activism, which is often seen as a bad thing - that’s not what the role of judges is traditionally supposed to be.
For the other branches it’s much more complicated, as they’re supposed to represent the people more directly. They don’t choose their moral code - the public does when it votes for them.
I just got home, it’s Friday night here and I’m a little drunk, so I don’t know if that makes sense haha. It’s an interesting question.