They are men's-room attendants.
Those outhouses are pay-toilet; each person using one must pay, probably 1 rupee (about one-and-a-half US cents). In the West, where labor is expensive, a pay-toilet has some automated mechanism to collect the fare, but in the poor countries, there is a human attendant with the same job.
I have seen this in Southeast Asia, where there is a strong cultural emphasis on both cleanliness and privacy, but not (except for this movie) in South Asia, where (completely!) public elimination is so common that it is a health hazard and the government struggles to get the population to use the free toilets provided.