@j_bertolotti so I think this is an equivalent formulation: instead of taking the top k dice out of n, calculate the probability of the value X from the sum of k dice with m sides (use the probability-generating function like you said) and then multiply the probability of the remaining n-k dice having all values less than or equal to the smallest value of the k dice.
Let me know if this formulation is correct or not and if it is helpful.
@sojournTime I need one more coffee in me before I can properly think about it, but it feels similar to how I first approached the problem (getting completely nonsensical results). Will let you know 🙂