"data on what careers all-girls school pupils end up in"
I think such data exists (at least for the UK, where there still are a number of single-sex schools) and the results suggest that girls are more likely to pursue STEM subjects at school (and, I imagine, careers later) if there aren't any boys in the class.
I suspect that boys in the class are far more influential than the teachers or other adult role models, simply because of the amount of exposure time to those influences. I am fairly confident that the effects are fairly small in the first few years of schooling but start having an effect pre-teen, when kids start thinking about each other's feelings a bit more, and since this seems to happen for girls a bit earlier than for boys, we probably have a situation where boys are having a negative influence and aren't capable of being aware of it. (You'd certainly be wasting your time explaining it to them, even if you thought they would listen to you.)
Later on, of course, the hormones kick in and both boys and girls pretty much lose their heads in an attempt to conform to each other's prejudices. (This appears to be a near-universal phenomenon. Even quite "sensible" and "nice" boys and girls will confess to all sorts of internal struggles and external mis-behaviour if you can persuade them to open up in later life.) You probably could sit everyone down at this point and try to explain to them what is happening to their heads, but Nature has a several-hundred-million year head start in brewing those hormones, so you are on a hiding to nothing. It appears to take several years before rational thought regains control. By then, everyone in in their twenties and career paths are largely settled.
I find this a rather gloomy theory because (i) it appears to rule out any effective intervention, and (ii) many people in later life *do* wish that they'd chosen differently in their teenage years.