If you mean differentiating between two families you can do that by picking the UID of the object that is equal to the UID of the other family.
E.g.
Pick familyA.UID = familyB.UID - - > [action]
Not sure that's what you're trying to do though.
Having the same variable for both families could be achieved by having another family dedicated to all the variables shared by the objects, but that's not the best and certainly not the most efficient way of doing that I suppose.
Transferring the variable to the other family could get really messy by the way.
Edit: Also, the above method would mean needing to do this differentiation condition every time you wanted to change the variable in an event for only one family.
Having a 3rd family that all members of both families are a member of certainly seems like the best option so far... but it's very frustrating, because all members of group A are members of group B but not vice versa, so sub-families would make everything very clean and logical and quick to do... your idea is the best thing available, though, I think.
EDIT: actually, the 3rd group option wouldn't work because then I wouldn't be able to reference it in events using group A OR B!