Srimad Bhagavatam Canto 01, Chapter 13, Text 15

SB 1.13.15

abibhrad aryama dandam
yathavad agha-karisu
yavad dadhara sudratvam
sapad varsa-satam yamah
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada
 
As long as Vidura played the part of a sudra, being cursed by Manduka Muni, Aryama officiated at the post of Yamaraja to punish those who committed sinful acts.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
Vidura, born in the womb of a sudra woman, was forbidden even to be a party of royal heritage along with his brothers Dhrtarastra and Pandu. Then how could he occupy the post of a preacher to instruct such learned kings and ksatriyas as Dhrtarastra and Maharaja Yudhisthira? The first answer is that even though it is accepted that he was a sudra by birth, because he renounced the world for spiritual enlightenment by the authority of Rsi Maitreya and was thoroughly educated by him in transcendental knowledge, he was quite competent to occupy the post of an acarya, or spiritual preceptor. According to Sri Caitanya Mahaprabhu, anyone who is conversant in the transcendental knowledge, or the science of Godhead, be he a brahmana or a sudra, a householder or a sannyasi, is eligible to become a spiritual master. Even in the ordinary moral codes (maintained by Canakya Pandita, the great politician and moralist) there is no harm in taking lessons from a person who may be by birth less than a sudra. This is one part of the answer. The other is that Vidura was not actually a sudra. He was to play the part of a so-called sudra for one hundred years, being cursed by Manduka Muni. He was the incarnation of Yamaraja, one of the twelve mahajanas, on the level with such exalted personalities as Brahma, Narada, Siva, Kapila, Bhisma, Prahlada, etc. Being a mahajana, it is the duty of Yamaraja to preach the cult of devotion to the people of the world, as Narada, Brahma, and other mahajanas do. But Yamaraja is always busy in his Plutonic kingdom punishing the doers of sinful acts. Yamaraja is deputed by the Lord to a particular planet, some hundreds of thousands of miles away from the planet of earth, to take away the corrupt souls after death and convict them in accordance with their respective sinful activities. Thus Yamaraja has very little time to take leave from his responsible office of punishing the wrongdoers. There are more wrongdoers than righteous men. Therefore Yamaraja has to do more work than other demigods who are also authorized agents of the Supreme Lord. But he wanted to preach the glories of the Lord, and therefore by the will of the Lord he was cursed by Manduka Muni to come into the world in the incarnation of Vidura and work very hard as a great devotee. Such a devotee is neither a sudra nor a brahmana. He is transcendental to such divisions of mundane society, just as the Personality of Godhead assumes His incarnation as a hog, but He is neither a hog nor a Brahma. He is above all mundane creatures. The Lord and His different authorized devotees sometimes have to play the role of many lower creatures to claim the conditioned souls, but both the Lord and His pure devotees are always in the transcendental position. When Yamaraja thus incarnated himself as Vidura, his post was officiated by Aryama, one of the many sons of Kasyapa and Aditi. The Adityas are sons of Aditi, and there are twelve Adityas. Aryama is one of the twelve Adityas, and therefore it was quite possible for him to take charge of the office of Yamaraja during his one hundred years’ absence in the form of Vidura. The conclusion is that Vidura was never a sudra, but was greater than the purest type of brahmana.
Srimad Bhagavatam Canto 01, Chapter 13, Text 14
Srimad Bhagavatam Canto 01, Chapter 13, Text 16