I think the under representation of women in science and engineering is more down to gender biases and the way parents have traditionally raised boys and girls differently.
As a society we have been more willing to support males in daring endeavors of exploration and science. This meant historically, scientifically inclined women were less likely to be funded by some benefactor, as was common with the scientists and mathematicians of Europe between 1500-1900.
There is for sure a natural set of interests different genders are encouraged to do by society, and this has meant less women are doing things that contributed to science.
we can opine about the state of the past or we can encourage and support the future. I know which is more important to me.
None of this takes away from the fact those women made the best of what they were given, had an unfair playing field compared to their "peers", who were handed everything, and yet we're able to make themselves their peers and yet weren't represented at all.