Scratch it, it won't work. It's been so long since I did any of this stuff I forgot that you can't use thislist in a trigger conditional, something about giving the trigger time to poll its contents.
It will need a slowly looping script, something along the lines of
#loop
~1
?(({_x in groupsPresent} count units groupName) == ({alive _x} count units groupName)) || (({_x in groupsPresent} count units groupName2) == ({alive _x} count units groupName2)):goto "fired"
goto "loop"
#fired
hint "trigger fired"
The script can be run from the beginning of the mission, and the ~1 could be changed to ~5 depending on how quickly you want to know any of the groups are there. More time = less lag.
The trigger will be set up as Anybody present, repeating, condition this, on activation groupsPresent = thislist.
Tested in OFP and works fine.