For mass production of broiler chicks, they just semi-starve both genders through their entire growth period so they do not develop the big breast.
You can download the "parent stock management guide" for several lines of broilers (or layers) as a .pdf. Some of them have charts showing what breast shape is desired for the breeders, and indicating how much to increase or decrease feed if it's not right.
Some companies even make special feeders for only the males (taller birds) or females (smaller head/comb/wattles) so they can give them different diets! Here's a link to one example:
https://www.bigdutchmanusa.com/en/p...breeder-management/feeding-systems/malechain/
The selective breeding of broilers (to develop better lines of birds) MIGHT require artificial insemination, but mass-producing broiler chicks certainly does not. And the companies have thoroughly separated those two parts--develop several good parent lines, then raise lots of the parent stock to cross in specific combinations, then raise enormous quantities of chicks from them to actually butcher (broilers) or produce eggs (layers.) They are all using 2-way or even 4-way hybrids, so they never pick a bird that was actually raised as a meat bird and expect it to reproduce.
And if they're not using AI for broilers, they're certainly not using it for the layer types.
Not a problem in a breeding program that is carefully developing new traits: one rooster per pen, with some number of hens.
Not a problem when producing thousands and millions of chicks: every rooster is an acceptable father for this purpose, and no chick from this pen will be used for breeding.
And the sperm CAN survive for up to 3 weeks--good fertility for the first week, then declining for the next 2 weeks or so. That matters any time someone switches roosters in a breeding pen, so it's pretty well known.