In the short term, yes. If a government, or other entity, could convince 51% of mining power to ignore blocks with particular transactions in them, the rest of the miners would quickly learn that they do not get paid for blocks that include those transactions or that are built on top of blocks that include those transaction.
One wrinkle is that many miners participate through mining pools that do not tell them what transactions they are mining. Any pools whose blocks didn't "stick" would soon be unable to pay those with the mining hardware. But miners are free to switch pools. A government could press on both mining pools and individual miners.
However, what happens in the long term is a bigger question. If the economic majority of the users of the bitcoin blockchain believe that this happening destroys bitcoin's value proposition, they could (at least in theory) decide to change the mining algorithm or even switch to some other technology like proof of stake. Another possibility is that bitcoin would just gradually start shrinking and soon be eclipsed by other blockchains that displayed more censorship resistance.
It's also possible that many might agree with the particular instance of censorship and decide that, whether or not they like it, it's not worth making radical changes or leaving bitcoin. So it's possible that, in effect, bitcoin could wind up tolerating censorship.
For people who are concerned about it, there are actions non-miners could take. For example, there could be gradual adoption of node software that refuses to accept censorship. If miners who build on the branch with censorship don't get paid for their blocks because nodes don't accept them, they become irrelevant.
Each node individually decides when to consider a block confirmed enough to rely on it. If demonstrated censorship is deemed by enough economically important nodes to deem a block unreliable, then miners would be in a stand-off with participants like exchanges.
So it's unclear exactly what the consequences of such a situation would be. Because miners are heavily invested in mining hardware, they would likely try as hard as they could to avoid situations whose outcomes are unclear.