Collective dynamics in a laser-pumped mixture of two atomic ensembles