I happen to be from a lower caste in India. Hence there are specific challenges I had to overcome to make it to college. I am not sure if I should talk about it in my diversity statement because there are quite a few professors from upper caste community in the departments I'm applying to and I'm afraid if mentioning my struggle will rub them up the wrong way. Is it a good idea to talk about my background in a diversity statement or is it better to leave it out?
Your diversity statement is not about who you are. It is about why you should be admitted to the degree program. In particular, it is about your ability to work with other people in the degree program and your later career, and how this ability will advance the goals of the degree program.
If your experiences relating to your caste has prepared you to work with other people, including perhaps disadvantaged people, then yes, write about that in your diversity statement.
The fact that there are upper caste faculty in the department is not very relevant. Faculty overwhelmingly come from a higher status background than applicants. There will be many applicants discussing experiences that are unfamiliar and uncomfortable to faculty. Avoid stereotypes and personal attacks.
I would recommend including it.
Please note that I haven't ever been involved in evaluating diversity statements, so take this with a grain of salt. This is just my impression based on my overall understanding of diversity statements and the factors in play with them.
While there might be a risk of a high-caste Indian professor seeing a discussion of being from a lower caste as something negative, if you're applying to an American school, I think it's much more likely that the people who analyze your application would be of European or African descent, and would likely be aligned with the Left wing of politics politically, because US academia is dominated by the Left wing in general.
Ultimately, the point of diversity statements are threefold: to show that you're capable of academic writing at the level required by the course, to show that you're willing to bend the knee to the Left wing ideology of intersectional oppression, and to help universities increase their diversity quotas by preferentially accepting students from "oppressed" backgrounds.
I don't want to get into a discussion about whether or not the groups that the Left associates with oppression actually are oppressed or not, because this is the Academia SE site rather than the Politics SE site, but I don't see how mentioning that you were from an additional oppressed group than the ones they usually consider, and that there was another axis for you to be oppressed by intersectional forces, would harm your application, though it may not help it much.
Frankly, the fact your skin is brown rather than white is more likely to be helpful to you - unless the PC brigade at that particular university have decided that Indians are "too successful" and are therefore no longer counted as an oppressed minority, like how Jews and East Asians are often treated, in which case the fact that you're Indian might count against you. In that instance, you mentioning your caste might also be a positive thing because even if they say that most Indians no longer count, then you should, because you're from an oppressed sub-group of Indians.