As it stands, your question contains some crucial ambiguities. You ask about a case where more As are observed in group X than in group Y, but it's really not clear what "observed" means here. Do you mean that quite literally, more things that are A have been, so to speak, counted in group X? And if so, were the observations random? That is: did each thing in X have an equal chance of being observed?
And then there's the question of how large the subsets we take are. I assume you mean them to be equal, but you don't say and it matters a lot. If you do, mean equal size samples, are they random? That matters too. And consider this: suppose group X contains far more objects than Y. Of the 10,000 objects in X, 100 are A. Of the 20 objects in Y, 18 are A. Suppose we take a random sample of 10 from each set. Though I'm not going to work through the details, even though there are far more As in X than in Y, the random sample from Y is likely to contain more As than the same-size random sample from X.
The real point is this: probability questions do not have answers unless they are posed precisely. As it stands, the probability question you've posed does not have an answer.
As it stands, your question
As it stands, your question contains some crucial ambiguities. You ask about a case where more As are observed in group X than in group Y, but it's really not clear what "observed" means here. Do you mean that quite literally, more things that are A have been, so to speak, counted in group X? And if so, were the observations random? That is: did each thing in X have an equal chance of being observed?
And then there's the question of how large the subsets we take are. I assume you mean them to be equal, but you don't say and it matters a lot. If you do, mean equal size samples, are they random? That matters too. And consider this: suppose group X contains far more objects than Y. Of the 10,000 objects in X, 100 are A. Of the 20 objects in Y, 18 are A. Suppose we take a random sample of 10 from each set. Though I'm not going to work through the details, even though there are far more As in X than in Y, the random sample from Y is likely to contain more As than the same-size random sample from X.
The real point is this: probability questions do not have answers unless they are posed precisely. As it stands, the probability question you've posed does not have an answer.