In the Gita, Krishna says to Arjuna to fulfil his dharma of Kshatriya by fighting to establish dharma and order in the world. What would Krishna have told an soldier in Duryodhanas side, to disobey his master and dishonor being a Kshatriya and lay down his arms or fight for an adharmic force, this is assuming every human has the capacity to know what is dharma and adharma, as we see in our complex world, things arent so black and white and good vs evil. Krishan himself sent his soldiers to fight for Duryodhana giving them no choice but to join an adharmic force.
Before I can answer this question it is necessary to understand the concept of svadharma.
It is indeed difficult in today's world to figure out one's svadharma.
One's own duty, even if without excellence (i.e. inferior in the scale of worldly values)is more meritorious spiritually than the apparently well-performed duty of another. For no sin is incurred by one doing works ordained according to one's nature.
This verse was interpreted by old commentators as jobs ascribed to particular castes. This verse is interpreted differently by those who think of varna as dependent on guna and karma.
These verses, which were easy for our ancients to understand, pose great difficulty for us today. So long as Varna was identified with the endogamous caste, and valid texts ascribed particular works to each caste it was easy to find out one's Svadharma, and if one had a will, to perform it too. That a priest's son should be a priest, a soldier's son a soldier, a merchant's son a merchant, an agriculturist's son an agriculturist, a serf's son a serf - is an arrangement that could be practised to some extent in the old feudal society when educational opportunities were restricted, when there was no choice in following professions, when social contacts were limited, and when the validity of the system was accepted by the people in general. But today such an idea of Svadharma hereditarily determined, is impossible of practice. Society and professions have become competitive. The imparting of education without any restriction imposed by caste, has helped the shuffling of professional abilities among all members of society, setting aside hereditary factors. So it has become honourable for any one to follow any profession, and the determination of Svadharma based on birth as in a caste based economy, has become impractical and impossible, and also undesirable. In a democratic society, the same kind of education is open to all, and every one is eligible, according to one's qualification and capacity, to positions of power, prestige and high income. In these days of national armies every able-bodied citizen has the eligibility to be recruited - he may even be conscripted - in the armed forces of the country. In such a milieu, if the Gita idea of Svadharma is accepted as caste based, as it was understood a few generations back, and as it used to be interpreted by old commentators, then it has become thoroughly outmoded and will be rejected by every section of society in India and outside.
But as already pointed out, the wording of the Gita about Caturvarnya, except as interpreted by old commentators, does not mean endogamous castes, but the four psychological types. If this is accepted, Svadharma would mean only work that springs out of one's own nature and therefore adapted to one's natural development. But how to recognise these types and how to provide them with work suited to their nature - is a problem that cannot be solved. We have to leave work based on psychological type as an ideal arrangement in a more rationally organised society of the future. There is no other way today but to understand Svadharma as the duty devolving on oneself in society, inclusive of the profession one follows. If that is done well with God in view, and not merely for remuneration or with a worldly master in view, then one may be said to follow Svadharma.
Commentary on Gita 18.47 by Swami Tapasyananda in his English translation of Srimad Bhagavad Gita.
The example you have given is not about svadharma but about moral choice. The troops on either side were doing their duty in the belief that fighting in a war is their svadharma. Whether any of the troops fighting on the Kaurava side should have refused to fight would be a moral question and has nothing to do with svadharma.