As per the information available online, there are no such study leaves in defence through which you can prepare for UPSC or there are no such consideration factor or provision to allow an officer attending any other examination. So if you wish to go for UPSC then you need to leave your job and then prepare for UPSC. Secondly, in UPSC there is a age limit i.e., the age of the candidate must be less that 28 years for UR candidates. So you have to keep in mind that also.
Secondly, being in defence will not give you that much of energy or time in which you can prepare for UPSC like tough examination. All though there is a famous quote that 'Nothing is impossible'. SO may be you can make it possible.
TO know more about UPSC you may visit the link below:
https://competition.careers360.com/exams/upsc-civil-services-exam
I hope this answer helps. All the very best for your future endeavors!
Application | Eligibility | Answer Key | Result | Cutoff | Selection Process | Preparation Tips
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile