Yes, you can write the UPSC Civil Services exam in Hindi medium.
The prelims question paper is set in both English and Hindi.
For mains, you can write your answers in Hindi or any other language listed in the 8th Schedule of the Constitution.
The compulsory English and Indian language qualifying papers are exceptions.
Choose the medium you are most comfortable expressing yourself in.