It seems like there are two very different questions intertwined on this one: The question of what, if anything, to do about government actions we disapprove of; but which enjoy strong local support; and the question of what government actions can or can’t be justified by strong popular support.
As far as ‘doing something about it’ goes; it’s not terribly hard to argue that enthusiastic intervention is a bad plan. Even if you can do it without stacking up truly egregious corpse piles; collapsing cooperative-puppet-governments have a nasty habit of being replaced by the worst of the people you were hedging against in the first place(looking at you, US/Iranian interactions). Doesn’t mean you have to be nice to a government you don’t like; or refrain from using whatever carrots and sticks are at your practical disposal to encourage them; but the historical record on ‘go in and civilize them, whether they like it or not’ is poor(we couldn’t even manage it in the south, after the civil war; only example I can think of that went well enough to point to is, possibly, post WWII Japan).
As far as ‘just what does a popular mandate justify’ goes, though, it seems to be fairly well accepted that, unless you think ‘tyranny of the majority’ is a compliment, the usual position is that certain measures simply aren’t on the ballot. Given the tendency of blasphemy laws to evolve(if they don’t start as) into tools for squishing unpopular minorities with various degrees of force; they among the especially unsympathetic flavors of majoritarian legislation. Oh, great, defend the popular people’s freedom from being offended at the cost of the liberties and/or lives of the ones who are already on the bottom of the totem pole; what could possibly go wrong?
Again, implementation is tricky; even jurisdictions with fairly stable, competent, judicial systems often struggle to keep oppressive majoritarianism at bay; and lots of jurisdictions aren’t nearly that lucky; but while this has to be acknowledged when deciding how to respond, it doesn’t make majoritarian legislation any more pleasant.
To draw on an American example; I’d say that ‘yup, when it can be managed, military imposition can beat local democracy when it comes to majoritarian excess.’ Sending the 101st Airborne to Little Rock, and seizing the local security forces from the governor, was not a triumph of democracy(and only does’t really qualify as ‘military government’ because nobody was dumb enough to try overt resistance to the army, so the uglier features of an occupation could largely be skipped); but the interests of the black population of Arkansas certainly couldn’t be left to the tender, loving, care, of the locals.
Obviously, sending in the troops to fix Pakistan or something would be a markedly worse plan; but while strong local support for something imposes practical limits on your ability to just bayonet it away, I’m not sure that it is ethically relevant.