You can stand up for yourself without being offensive to the person. Attack their words, not them. You'll find yourself getting in less trouble, and you won't stoop to their level.
I believe that whenever someone does or says something that is hurtful to someone else, they need to be corrected for it by the rest of society. Ignoring it makes them think it's acceptable for them to do it and they are special because they alone can get away with it. It's like people who steal things for the sake of stealing things, they get a thrill over not getting in trouble for doing something unacceptable.
If we all stood up for ourselves, I think there would be far less people looking around for a cheap shot at someone. Most people are not looking for confrontation when they are rude to a perfect stranger, they are looking to get away with it.