If I’m following correctly, the issue is that you don’t want a member of Group A to be able to see that a member of Group B exists on the site at all?
I don’t think that’s possible. Group membership can be private, so a member of Group A can be prevented from seeing who is part of Group B… but you’ll always be able to see which users exist on the site even if you can’t see their group membership.
One thing that might help is setting Who can see this group? to Group owners. In that case normal group members wouldn’t even be able to see that they belong to any group at all.