Just then a muni, named Aprameyabala, who had four kinds of knowledge, came to the garden Kusumāyudha. In that same place at night his brilliant omniscience appeared and the gods held an omniscience-festival. At dawn Rāma and Saumitri, Kumbhakarṇa and others, went and paid homage to him and then listened to dharma. At the end of the sermon Śakrajit and Meghavāhana, who had reached extreme disgust with existence, asked about their former births. The muni said:
“In the city Kauśāmbī here in Bhārata you were two poor brothers, Prathama and Paścima. One day after hearing dharma from Muni Bhavadatta they took the vow and became mendicants, their passions subdued. Once upon a time they went to Kauśāmbī and saw King Nandighoṣa sporting with his wife Indumukhī in the spring festival. Seeing him, Paścima made a nidāna: ‘By this penance may I become their son, engaged in such sport.’ Though restrained by the monks, he did not retract the nidāna and after his death Paścima became their son, Rativardhana. In course of time having grown up, Rativardhana succeeded to the kingdom and, surrounded by his wives, engaged in numerous sports, like his father.
After his death the monk Prathama became a powerful god in the fifth heaven as a result of his penance free from a nidāna. Knowing by clairvoyance that his brother had become king there, the god went in the form of a muni to enlighten him. He sat down on a seat offered by King Rativardhana and related his former birth and his own from friendship for his brother. Rativardhana became disgusted with existence from the recollection of his births which was produced, became a mendicant, and after death became a god in Brahmaloka. Then, having fallen, you became brothers, kings in Vibuddhanagara in the Videhas and went to Acyuta after becoming mendicants. After falling from Acyuta you became now the sons, Indrajit and Meghavāhana, of the Prativiṣṇu Daśāsya. Rativardhana’,s mother, Indumukhī, became your mother, Mandodarī, after wandering through births.”
IT IS MENTIONED HERE : https://www.wisdomlib.org/jainism/book/trishashti-shalaka-purusha-caritra/d/doc214074.html
And it is from purana or any other hindu scripture.I need to know the name and more detailed view of you all.Thanku in advance