Bharatvarsh now India has always existed as one united nation and peoples. Especially since the Mauryan age. Thus, why did Indians/Bharatiyas betray their fellow countrymen and brothers to foreigners?
India as a national unit and country has existed since more than a millennia.
I think we need to be clear that India as a national unit really came into being after its independence and its inception as a concept began within the later stages of the Indian independence movement. The concept of "India" as one national entity simply didn't exist in the ancient or medieval period. What did exist was a number of terms that defined different parts or portions of the Indian subcontinent taken together.
For example
Bharatvarsh now India has always existed as one united nation and peoples.
The term you used here, namely, "Bharatvarsha" was initially used to denote the region under the rule of the Bharata tribe mentioned in the Rig Veda. Later, Puranas and Mahabharata expanded the meaning to cover the entire region where Indo-Aryan cultural or political hegemony prevailed.
Similarly, terms used in ancient scriptures to define various territorial units as something, were redefined due to changing circumstances. For example,
The Baudhayana Dharmasutra (800 BCE -600 BCE) defines the region known as Aryavarta as a region lying west of Kalakavana, east of Adrasana, south of the Himalayas and north of the Vindhyas.
Meanwhile, the Vashishta Dharmasutra (500-300 BCE) as well as Patanjli's Mahabhasya (mid 2nd century BCE) defines Aryavarta as the land between the Ganged plains and the Thar desert.
Therefore, these geographical terms don't denote all of India and rarely ever have. They indicate the region that was inhabited or ruled over by the Indo-Aryans and their definition changed according to the political and cultural sphere/regions that the Indo-Aryans or Vedic culture influenced or controlled.
Especially since the Mauryan age.
Keep in mind the fact that after the fall of the Mauryan Empire, the subcontinent wasn't conquered by any singular entity to the same extent as the Mauryans, therefore a political united unit in the entire subcontinent simply didn't exist.
Thus, why did Indians/Bharatiyas betray their fellow countrymen and brothers to foreigners?
I'm assuming you're taking about the sepoys who joined the armies of the EEIC.
As far as their motivations are concerned, the common peasant of this period usually did not posses a sense of nationalism or nationhood. War was ever present and Nawabs/Rajas and dynasties were overthrown quite often. Usually men enlisted in the army either because they were Brahmins and Rajputs (in other words, men from the caste groups that had served in military roles since antiquety and therefore occupied a position of monopoly over the military labour market, were land owning peasants and fell into the category of martial races used by the EEIC armies for recruitment) and belonged to a long line of soldiers and military adventures, hence tradition. Or because they were land owning Brahmins or Rajputs who required additional income and were looking for livelihood.
Simply put, the idea of betraying a nation or country wasn't a concern for the people in this period. Since the idea of a nation or country did not prevail among the common peasant or an aspiring soldier.
Peasants primarily owed loyalty to and recognised the authority of their immediate feudal lords, these being zamindars. While the concept of an Empire/kingdom ruled by a monarch existed, it was fairly usual for monarchs to be overthrown and for regimes to change.
This was even more true in the turbulent period of 18th century India. This was a period marked with nigh incessant warfare, between the Marathas, the Mughals and Nawabs and Nizam, borders fluctuated constantly, loyalties shifted over generations and within decades, and political uncertainty was the norm. Therfore, the idea of India being united since the Mauryan age, simply doesn't hold true, as it was divided among regional political entities immediately after the fall of the Mauryan Empire and was never united to the same extend again even under the Mughals, except for finally when the British Raj was established and reached its zenith.
To add on to u/MaharajadhirajaSawai's post, here's a previous thread asking this same question, with the same assumption of Indian nationhood, as ably answered by u/IconicJester and u/Sikander-i-Sani.