However, they have to be pretty committed to this, because if someone outside of the group does eventually mine a block that contains the censored transaction, the group members also have to be willing not to build on that block, and to trust each other not to do so. Just agreeing not to include the transaction in blocks themselves would be insufficient.
At that point there are complicated questions about how stable and credible the arrangement will be, since systematically avoiding building on certain mined blocks involves slowing down the consensus slightly, and also trusting that the eventual consensus will exclude those blocks.
If, say, 51% of mining power committed to censoring one particular transaction, that might yield an effective fork of Bitcoin for some period of time because the other 49% might gamble on their ability to get their rival blocks accepted in the long term (or, if they didn't know about the 51%'s policy, not see any reason why they shouldn't simply build on what appeared to be the longest chain!).