You could create a custom Dataset and return a single sample from A and two from B.
Using a batch size of 10, each batch would then contain the desired amount of samples from each dataset.
However, to properly implement it, we would need to know if the lengths of both datasets match, i.e. len(A) * 2 == len(B)?