The solution is actually quite simple. Being able to choose your child's sex. If women have happier and easier lives, parents will prefer having daughters which will in turn increase the female population and decrease their value, bringing the value of sexes to an equilibrium.
Wow! I never thought of it that way, but it makes sense. Though if unhappy men are mostly invisible to society, that might lead to parents choosing boys under a wrong impression.