You could use a WeightedRandomSampler for the concatenated datasets.
If you need to sample a complete batch from one of the internal datasets only, you could create a custom sampler, create the indices internally and return the batch indices to the custom dataset.