Actually they did, especially in the mid-to-late 19th century - the British favoured the Muslims over the Hindus then - dealing with the Mughals and their vassals. It took the 1857 revolt to change that.
Interesting to read the old stories of the Mutiny.
While Muslims and Hindus lived and fought side by side, there didn’t seem to be a great deal of antagonism between the two, at least not at that time. They didn’t seem to have any trouble at all ganging up together on the British. In fact, while religion played a part in the Mutiny, it was mostly common antipathy to Christianity, not Muslim vs. Hindu stuff.