The mooks spawned on Deck 2 and Deck 3 both use the same setup (with only minor differences in the UTCs spawned). The module heartbeat that spawns them has a check against a global number (K_STA_HORDE), which stops spawning once it hits 9 and a global boolean (K_STA_SPAWNER) which is an on/off switch. There is a trigger OnEnter that resets the global back to 0, but that has a local boolean check so that it should only fire once. However, on Deck 2 there are three reset triggers and on Deck 3 there are five reset triggers. On top of that, there's a start trigger that also sets the global back to 0 and sets K_STA_SPAWNER true to start the spawning. On Deck 3 there is only one of these triggers (which you'd expect), but on Deck 2 there are five of these, effectively acting as reset triggers. I'd guess these work in conjunction with cutscenes, but I haven't checked that. By my count, that should mean a maximum of 40 mooks on Deck 3 but 56 on Deck 2. You'd need to add a counter script to verify it though, since it's entirely possible that other resets happen during cutscenes.
In terms of stopping them, the easiest solution is probably to add a new global number that increments with each spawn and then have it terminate the spawning script once it reaches whatever arbitrary cap you decide on. Alternatively, a less intrusive option would be to simply lower the K_STA_HORDE check value, so the spawner terminates sooner each timer it resets.
Edit: So I just did a quick run through with some kill blasters and with a counter added to the scripts. I ran around until they stopped spawning. I got a total of 28 mooks on Deck 2 and 47 on Deck 3. I think I may have hit some reset triggers early on Deck 2, which reduced the count there, but Deck 3 gave me more than I expected, so I gather there must have been additional resets somewhere. Maybe via door OnOpen scripts or something.