Yes. And respectfully and carefully playing to their ideals when they are uncomfortable with the reality your actions have just cast light on is a good way to move the bar, far more effective than such a personal attack. I don't know how it would apply in a work setting, but my ex husband had a big disconnect between his non-sexist ideals and the way he lived/assumptions he made. On more than one occasion, I played to his ideals and kept my mouth shut about his sometimes weeks-long grumpiness over the friction between his ideals and his unstated assumptions/expectations. This allowed me to gradually improve the latitude I had for pursuing my own goals in a situation where I was 100% financially dependent, with special needs kids in tow.
Humans are kind of like buggy software. There is often contradiction between what they believe and how they behave. That fact can be used as a force for good rather than just an accusation. You just have to put the emphasis on the part you want to grow rather than on the part you are offended by.
I'd recommend reading up on the topic of persuading people if you feel shaky. "How to Win Friends and Influence People" is a pretty good classic starter. How you approach this kind of stuff can make all the difference in the world. (And I'm not saying that they weren't unfairly discriminating against you. But there are good ways and less-good ways to address that situation, and picking a fight should usually be a last resort IMO.)