महाराज (Sanskrit) comes from Sanskrit राजन्, from Proto-Indo-Aryan Hrā́ȷ́ā, from Proto-Indo-Iranian Hrā́ȷ́ā, from Proto-Indo-European h₃rḗǵs, from Proto-Indo-European h₃reǵ- — to straighten, to right oneself; right; just.
Ancestry of “महाराज”, step by step
महाराज traces back through two separate lines of ancestry.