This edition of the Mahabharata, translated by K M Ganguly, contradicts the above citation.
The Yaksha asked,--'By what, O king, birth, behaviour, study, or learning doth a person become a Brahmana? Tell us with certitude!' Yudhishthira answered,-'Listen, O Yaksha! It is neither birth, nor study, nor learning, that is the cause of Brahmanahood, without doubt, it is behaviour that constitutes it. One's behaviour should always be well-guarded, especially by a Brahmana. He who maintaineth his conduct unimpaired, is never impaired himself.
Professors and pupils, in fact, all who study the scriptures, if addicted to wicked habits, are to be regarded as illiterate wretches. He only is learned who performeth his religious duties. He even that hath studied the four Vedas is to be regarded as a wicked wretch scarcely distinguishable from a Sudra (if his conduct be not correct). He only who performeth the Agnihotra and hath his senses under control, is called a Brahmana!'
We have another scripture (vajrasuchika upanishad) also saying that one becomes a brahmana not by birth, but by his qualities.
There are four castes—the brāhmaṇa, the kṣatriya, the vaiśya, and the śūdra. Even the smṛtis declare in accordance with the words of the vedas that the brāhmaṇa alone is the most important of them.
Then this remains to be examined. What is meant by the brāhmaṇa? Is it a jīva? Is it a body? Is it a class? Is it jñāna? Is it karma? Or is it a doer of dharma?...
To begin with: is jīva the brāhmaṇa? No...
Then is the body the brāhmaṇa? No....
Then is a class the brāhmaṇa? No. Since many great Ṛṣis have sprung from other castes and orders of creation—Ṛṣyaśṛṅga was born of deer; Kauśika, of Kuśa grass; Jāmbuka of a jackal; Vālmīki of valmīka (an ant-hill); Vyāsa of a fisherman's daughter; Gautama, of the posteriors of a hare; Vasiṣṭha of Ūrvaśi2; and Agastya of a water-pot; thus have we heard. Of these, many Ṛṣis outside the caste even have stood first among the teachers of divine Wisdom; therefore a class is not the brāhmaṇa.
Who indeed then is brāhmaṇa? Whoever he may be, he who has directly realised his Ātmā and who is directly cognizant, like the myrobalan in his palm, of his Ātma that is without a second, that is devoid of class and actions, that is free from the faults of the six stains and the six changes, that is of the nature of truth, knowledge, bliss, and eternity, that is without any change in itself, that is the substratum of all the kalpas, that exists penetrating all things that pervades everything within and without as ākāś, that is of nature of undivided bliss, that cannot be reasoned about and that is known only by direct cognition. He who by the reason of having obtained his wishes is devoid of the faults of thirst after worldly objects and passions, who is the possessor of the qualifications beginning with śama, who is free from emotion, malice, thirst after worldly objects, desire, delusion, etc., whose mind is untouched by pride, egoism, etc., who possesses all these qualities and means—he only is the brāhmaṇa.
Nor does the Lord distinguish anyone based on birth as Sri Ramanuja mentions in his commentary on bhagavad gIta 9.29.
9.29 I am the same to all creation. There is none hateful or dear to Me. But those who worship Me with devotion abide in Me and I do abide in them.
Commentary by Sri Ramanujacharya
9.29 Being a refuge for all, I am the same to all creation, be they gods, animals, men or immovables, who exist differentiated from the highest to the lowest according to their birth, form, nature and knowledge. With regard to those seeking refuge, none is hateful because of inferiority in status by birth, form, nature, knowledge etc. No one is discarded as an object of odium. Likewise, it is not that one who has resorted to Me is dear to Me on account of any consideration like birth, status etc. That he has taken refuge in Me is the only consideration. The meaning is no one is accepted as a refuge for reasons like birth. But those who worship Me as their sole objective I like, because I am exceedingly dear to them, and because they find it impossible to sustain themselves without My worship. So they abide in Me, irrespective of whether they are exalted or humble by birth etc. They abide in Me, as if they possess qualities equal to Mine. I also abide in them, as if they are My superiors.