You regain respect by getting clarity on what they meant when they said the humiliating thing. "When we were X, you said Y. By that, did you mean to imply Z?"
They'll either clarify that they didn't mean Z or they will double down and explicitly ridicule you.
In the first case, problem solved. Maybe you talk about why his words would make a reasonable person feel ridiculed, maybe you don't. Either way, you've eliminated the possibility of misinterpretation, which always exists when humans communicate.
In the second case, you need to actually confront him about that if you want to gain respect. Look him in the eye and say something like, "Okay look dude, we're here to help each other learn and solve problems. If you're going to ridicule someone for asking a clearly-framed question, you're not doing a good job at that. That's a serious problem. How can I help you practice that?"
Is this confrontational and therefore uncomfortable? Absolutely. Does it require enduring an uneasy feeling in your bowels as you stand up straight and maintain eye contact? yep. But being willing to deal with uncomfortable situations, keep calm, and drive problem-solving-focused confrontation is necessary for the sort of leadership that earns the respect you are looking for.