This topic comes up a lot and there are many (contradictory) nationalist myths about who did and did not collaborate with the British during their rule in India. Major Amin has a short podcast about this topic that is worth listening to:
India was conquered by the East India Company using (mostly) the Bengal army, recruited primarily from what is now eastern UP and Bihar. Most of these soldiers were Hindus and a large section were Brahmins, but all religions, ethnicities and castes joined the EIC army at various points and all have examples of mutinies (many small, one large), frequently triggered by grievances over pay and conditions, but sometimes acquiring or having a nationalist color as well. Have a listen.