Each county sheriff's department has an Equal Employment Opportunity (EEO) plan, which includes the right to complain about suffering unlawful discrimination, based upon race, color national origin, religion, sex, age, or disability. Since I don't know the county in which you're employed (and, except for a few large counties, the EEO plans are not available online), I cannot provide an absolutely definitive answer.
However, if you get a copy of the EEO plan, and you believe that there is some ulterior motive in your demotion and treatment related to unlawful discrimination -- or, if the EEO plan specifically describes some other right about which you may complain, then that plan is your "roadmap" to having this matter resolved.
Were I representing you, I would carefully review all of your facts, and compare it with the EEO plan, and then I would try to find a valid complaint. Then, I would draft a letter or fill out a complaint form (if one is provided by the plan), and I would file it -- because by doing this, the law requires that any further retaliation must cease immediately. And, in the real world, because it's very difficult for coworkers and supervisors to simply "turn off" the discriminatory conduct, this frequently is enough to actually create a new cause of action against the public employer for retaliation. Which then provides grounds for legal action, and to potentially force a settlement, before a lawsuit is filed.
That's the lawyer's game plan, and it's how you may want to proceed with your claims.
I hope I've answered your question. Please let me know if you require further clarification. And, please provide a positive feedback rating for my answer -- otherwise, the website retains your entire payment, and I receive nothing for my efforts in your behalf.
Thanks again for using Justanswer!