I assume most countries picked the best candidates for their teams, as mathematical aptitude is relatively easy to quantify. If it wasn't the competition would have no meaning. Congratulating Ukraine and Bosnia for this like it's some heroic sacrifice is odd. These girls were the best choice for their teams so they were picked. I don't see much more to it than that.
I would congratulate Ukraine and Boznia-Hertzegovina for creating the educational system in which talented girls flourished at the same level as talented boys and so which it came time to pick the the competitors, it was statistically likely that they'd end up with a gender-balanced team.
> I assume most countries picked the best candidates for their teams
The fact that there are statistically significantly more men among the best candidates is already enough to conclude that there was a gender bias. The bias can be in the education or in the selection process, etc.
The fact that Ukraine and Bosnia-Herzegovina have gender balanced teams mean that they have managed to avoid this bias, one way or another but not necessarily though positive discrimination, maybe they simply a more balanced education, maybe they have a more extensive selection process where they retrain the students from scratch before selection etc. Eitheir way, they deserve some credit for that.