Yes, it is sometimes ethical to override a democratic vote or a majority opinion.
In your example, say that a criminal is sentenced to death, and that the governor of the state has the final word on whether the sentence will be executed. Let's suppose there is no doubt that the criminal effectively committed the crime for which he or she has been sentenced. And that the majority of the population supports, not only death penalties in abstract, but also the execution of this particular criminal.
Is it ethichal for the governor to suspend/cancel the sentence? Maybe. Of course not if he accepts a bribe for doing it, or if it is based on some personal relation between governor and accused. But if it is based upon a principled opposition to the death penalty, or to its application in the particular case, then I would say yes, it is ethical (what it probably isn't, is political expedient.
Would it be undemocratic? Also no, for the constitution of the state, which is itself the product of a democratic deliberation, bestows this decision upon the governor.
If you see a law as immoral or unjust, it may even be a moral duty to disobey it, never mind how many people disagreee with you.
More generally, we take for granted that some decisions are subjected to the democratic vote (are we going to build a bridge over this river, are we going to criminalise the use or commerce of marijuana or krokodil, etc.) and that other decisions are definitely outside the scope of democracy (who will Jane marry, can John sell himself into slavery or not, should we torture the criminal in the first example before the execution, is the Bible to be taught in school as literally true, and so on). But a long time, a lot of effort, and several mistakes and miscarriages were necessary for us to pacify these views.