Atheism in part of Hinduism, the definition of atheism in hinduism is the one who does not have belief in Vedas. Indika by megasthanese seems to be western understanding of Hinduism, unlike Al-Baruni, Megasthanese was not trained in Sanskrit and Al-Beruni’s writings never mentioned the seven varnas, he wrote it correctly.
The difference between Ramayana and Mahabharat is the rigidity with which caste system. Valmiki, the writer of Ramayan was Dalit, but Karna was Sut-Putra through out the text, Draupadi declared that she won’t marry even if he hit the fish, nor was Eklavya the tribal was granted access to ashram of Dronacharya. So what when was Mahabharat conceptualized