But it's not bullet-proof. When the criticism is private, there is no signal to the rest of the group that the behavior in question is not appropriate. The person being criticized certainly isn't going to say anything. This can lead to the situation where the behavior by one person is stopped, but as a whole it continues due to the fact that there is no social signal to the rest of the group to stop.
So, as with many things, there is no clear cut approach that works all of the time. Knowing when to signal something publicly or privately is a skill like any other.
However, this can also go very badly. But I am mentioning it to note that there are alternatives to the two scenarios posited of either criticizing privately in order to protect the offending individual's ego or criticizing publicly so everyone gets the memo that the behavior is not a good idea. If you are careful and acting with good intent, sometimes you can protect the person's ego while publicly commenting on the fact that the behavior in question is not desirable.
There are other ways to give push back as well that actually moves the needle and doesn't just change who gets crapped on.
I've been at two separate jobs where I encountered people like this. (Thankfully, I did not have to directly work with them - that would have been tough). Coincidentally, both had the title of "Senior Architect" or something like that, and both were extremely bellicose and condescending in their tone to a variety of people, both in person, on the phone and in emails.
In both cases, I knew of multiple people who had complained about the individual's behavior to management yet in both circumstances, nothing was done and the behavior continued. In one case, more than one person quit and specifically called out the offensive person in their "farewell" email. (This is not something I would recommend)
I eventually left both positions, for other reasons. In one case, during my exit interview, I was specifically asked by HR if I'd ever experienced any "difficult" behavior from the individual in question. I declined to give any details, as by that point it was clear to me that management not only ignored this behavior but condoned it as well. (You may not agree with my course of action) As far as I know, both of these people are still working at the same places, and I'm assuming nothing has changed.
This is unfortunately how many of these situations end up. My advice is to choose your battles wisely.
If this happens visibly to the team it is likely that the person behind the behavior will take this as an attack, especially if he/she is a true asshole. Not good for long-term working climate. Also, it has a flavor of "white-knighting" oneself if it's done in front of the team.
A more diplomatic and expedient approach would be
a) Approaching the person behind the behavior in private and letting him/her know that such behavior isn't tolerated. And
b) approaching the targeted person in private and assuring him/her of your support in case it happens again.