You can build hierarchical mixtures, but it’s not clear to me that it works here because you have continuous parameters generating discrete observations. You might be able to model a binomial mixtures of Bernoulli likelihoods, but that would require you to model every single observation (rather than N and p you would just have p and every observations would be a single “flip”). Maybe someone more clever than I would be able to work out a better solution.