Females don’t do better in threes - having two is absolutely fine. Females are wired to live in groups so however many you have, it is in their nature. Having three can be problematic as there is always the chance of an outsider situation and one piggy being left out. It is generally easier to have harmony if you work in even numbers of piggies. So I would stick to two females.
The cages may not be next to each other but the boars will absolutely still smell the females even if they are in the same room. There will always be a risk of fights between the boys if they smell the girls.
To stand at chance of keeping boars and sows in the same room and minimise the risks to the boys relationship, the cages ideally to be stacked one on top of each other with the sows at the bottom so their smell can’t fall into the boys. Boys must always be handled first. If they are to remain level with each other, then ensuring they are as far away as possible, or have dividers that higher and wider than normal. Also ensuring there is no way of the boys getting out of their cage. Boys, upon smelling girls, become quite agile and some have been known to escape cages climbing bars to go and get in with the girls.