Title. When I hang out with my male friends we have equal talk-stuff having fun together. When there's a girls around they starting act like douchebags towards me-my attempts to approach X woman. For example telling cringe stories about me/trying to make really stupid jokes about me.

They do act like this only when girls around, I don't feel myself any beta, but they making me seem so when females are around.

How do I handle these types of situations? I don't want to hurt relationships with my friends(well, they are good friends outside of this bs), I can't make them stop when it happening(well it will look very awkward) and not sure if it has a point to talk about it afterwards.

What do you do in cases like this?