I spent a month backpacking India, but I don't know a ton about the caste system. Obviously in modern India, caste may or may not have much to do with the military, but I'm thinking about the caste system in a more ancient time, not necessarily specific to India.
Here are some questions that might help you hone the details of your answer:
If there were a call to arms who would be called?
In India the Khsatriyas are the warrior caste (second highest, only to the Brahmins priests), so would only they be required to fight?
Are the lower castes off the hook or do they just serve lower roles in the military?
If a lower caste person (like a shudra, the artisans, farmers, blue collar workers, servants) join the military if they wished?
What if they weren't so low as the shudra, but something like a vaishyas (the merchant class just below the khsatriyas, still considered "twice born" in the Hindu tradition, unlike the shudra)?
edit: for clarification
I think your understanding of the caste system is a bit incomplete. Most people are familiar with the Varna system, which is the 4+1 tier system- Brahmins, Kshatriyas, Vaishyas, Sudras, and Dalits. In reality, these are the caste distinctions that people have applied in day to day life.
It is the Jati system that is the more prominent caste-based socioeconomic system. Think of Jatis as you would clans, except these clans are based around a profession. You have, for instance, the Chamar 'caste' of leather workers or the Rajput 'caste' of warriors. In many cases, many, if not most, members of each jati didn't adhere to the occupation of their caste - there could be 40 Chamars in a village, but you really didn't need more than 1-2 leather workers. As a result, most people of all castes were usually involved in activities like agriculture.
These Jatis like to categorize themselves within the 4 tier Varna system, and this categorization wasn't permanent either. Most famously, the Maratha Emperor Shivaji Bosle was actually the leader of a farming 'caste'; upon his glorious victories and powerful political and economic might, he and his caste were 'promoted' (by their decree and by the ceremonial rubber stamp of Brahmin priests) to the more appropriate Kshatriya caste.
To get back to your question, you shouldn't think of a village of 100 people, with 20 Kshatriyas who were the village contingent of warriors. As in the case of Shivaji and his farmer 'caste', castes instead operated like clans. And these clans could dominate an area by either military might or economic means (namely by landholdings).
I admittedly can't answer how a member of the non-dominant caste or Jati of an area could join the local 'army' contingent, and what his role would be. But I do think framing the question correctly will help others connect the dots with the research/books they've come across on this topic.