allying with friendly women is often the easiest way to correct other people. let someone else tell them how horrible they are.
another thing to do when they address you as mr or sir is to blink confusedly at them and ask "excuse me?". just like someone here mentioned. it's a way of telling them they're making a mistake without calling them out on it, and giving them a chance to correct themselves without things getting embarrassing to anyone. take note of who still persists in making mistakes, those are the ones to look out for.
ignoring people when they use the wrong form of address is something i've done a few times. if someone really wants to talk to me, the least they can do is getting this right. unless they actually forgot my name or made a funny slip, like when a superior once called me her husband's name (our names are pronounced very similarly). i have many times successfully just rose an eyebrow at a person addressing someone or something or whatever in the wrong way, they always correct themselves or admit they just forgot what it/they was supposed to be called when i silently refuse to let them make the mistake.
if someone insists on doing it wrong, the next step i'd take would be to misgender the other person on purpose (without changing the level of respect i talk to them with. just a casual misgendering), to point out what they're doing to me without really pointing it out at all. i haven't had the chance to try that with anyone, but it would be funny if they started making a fuss about it, and i then explained that i thought we'd switched the gendering since they insist on calling me the opposite of what i am. i like to use upside down logic and asking weird questions. on a bad day i'd probably be mean enough to ask another person who they are talking about, but with these solutions you'd have to be prepared for some conflict. i'm not really recommending them for people who wish to have a peaceful life.