In Bharata dynasty (in which Yudhishthira and Duryodhana were born), it was not necessary that only the eldest son of a king will become the next king. The one who was worthy of becoming a king used to be chosen. Even king Bharata himself didn't appoint his eldest son as his successor:
And Bharata begat upon his three wives nine sons in all. But none of them were like their father and so Bharata was not at all pleased with them...
The monarch then performed a great sacrifice and through the grace of Bharadwaja obtained a son named Bhumanyu. And then Bharata, the great descendant of Puru, regarding himself as really possessing a son, installed, O foremost one of Bharata's race, that son as his heir-apparent.
~ The Mahabharata: Adi Parva: Sambhava Parva
Yudhishthira was best choice for Yuvaraja because Yudhishthira was more worthy of becoming a king than Duryodhan:
Vaisampayana continued, 'After the expiration, O king, of a year from this, Dhritarashtra, moved by kindness for the people, installed Yudhishthira, the son of Pandu, as the heir-apparent of the kingdom on account of his firmness, fortitude, patience, benevolence, frankness and unswerving honesty (of heart). And within a short time Yudhishthira, the son of Kunti, by his good behaviour, manners and close application to business, overshadowed the deeds of his father.
~ Mahabharata: Adi Parva: Sambhava Parva
The citizens were also happy with the heir-apparent Yudhishthira and wanted to make him king:
Then the citizens, beholding the son of Pandu possessed of accomplishments, began, O Bharata, to speak of them in all places of public resort. And assembled in courtyards and other places of gathering, they talked of the eldest son of Pandu (Yudhishthira) as possessed of the qualifications for ruling the kingdom. And they said, 'Dhritarashtra, though possessed of the eye of knowledge, having been (born) blind, had not obtained the kingdom before. How can he (therefore) become king now? Then Bhishma, the son of Santanu, of rigid vows and devoted to truth, having formerly relinquished the sovereignty would never accept it now. We shall, therefore, now install (on the throne) with proper ceremonies the eldest of the Pandavas endued with youth, accomplished in battle, versed in the Vedas, and truthful and kind.
~ Mahabharata, Book 1: Adi Parva: Jatugriha Parva
But later evil Duryodhana tried to kill Yudhishthira and his brothers in lakshagriha with their mother. And only on the false news of Yudhishthira's death in lakshagriha, Duryodhana was chosen as Yuvaraja.
By birth (direct son), neither Duryodhana nor Yudhishthira had a right on the throne because technically neither Duryodhana nor Yudhishthira was Kuruvanshi (Kaurava), a new name of Bharata dynasty after king Kuru. Because king Shantanu had three sons Bhishma, Chitrangada and Vichitravirya; Bhishma was bhramachari and other two died before producing any child. By the grace of Vedavyasa, all three Dhritarashtra, Pandu and Vidura were born after death of their father Vichitravirya. However, by the grace of Gods (Dharmaraja, Indra, Vayu, Ashvinis), all 5 Pandavas were born in front of their father Pandu. By birth (direct son), only Bhishma had right on the throne because he was the only Kuruvanshi/Kaurava (direct son of Shantanu) at that time.