I suppose, if they're just kind of "self-righteous thinkers" but aren't criticizing anyone else you ignore them, or even consider the possibility that they may seem more self-righteous to you (and/or others) than they really are.
If they're criticizing other people and being self-righteous it may not be a bad thing to point out to them that it's easy to be self-righteous if someone hasn't been in the exact same situation (EXACT SAME) as someone else and doesn't really know how things can happen, or how people start to think/feel in that situation. Some of my biggest "inspirations" for Hubs have been self-righteous attitudes I've seen online and decided to kind of "defend" people who are often the object of others' self-righteousness.
If they're self-righteous and criticizing you, you could either explain to them exactly what it is they don't understand (if you're doing something they don't understand and that has a good explanation if someone did understand). (If, on the other hand, you're doing stuff that you shouldn't, and for which there isn't any real good excuse, you may want to just ignore them; and kind of realize that some behavior invites self-righteousness. I'm not suggesting you are - just covering the bases for the purposes of answering this question.)
In fairness to SOME people who may seem self-righteous but aren't really, there are times when someone works hard to do the right thing and cares very much about doing the right thing; not "to get point", but because he cares very much about being responsible or being a good friend. It can be difficult for someone who works so hard, cares so much, feels as if he's always trying, and often sacrifices for others because he wants so much to be responsible and caring. All their efforts can be their focus, so some people may just talk a lot about what they do or think because caring and trying are so "high on their priority list". So sometimes, if someone doesn't seem awfully arrogant about it and just seems "a little on the self-righteous" side, maybe the thing to do is give them a pass.