We all commit in some way or another various sins (pāpa) and good acts (puṇya).
My question pertains to the situation:
Suppose one person, might be conducting themselves in all righteousness (dharmic), as per all injunctions of the scriptures. However, despite being righteous (as per scriptures), they have latent ego (ahaṃkāra) inside them of being "righteous". Then there might be a second person who might be doing all kinds of sins (deliberately or non-deliberately), as per against the scriptural injunctions.
Sometimes people might have ahaṃkāra of being born in a certain social or gender setting. They might consider the other people as inferior, due to that ego.
Is the ahaṃkāra (ego) developed as a result of "being good or better" more worse and dangerous than the pāpa (sins) accumulated done via activities which oppose the Dharma?
Who between the two is the worst sinner? The one who's scripturally righteous, but with ahaṃkāra, or the one who is a sinner (unknowingly or unknowingly)? Does scriptures makes any such kind of distinction and explain them? Views of āchāryas and gurus are also welcome.