Those righteous dead are those the Lord had mercy on; those who followed God before the coming of Christ to the world. The greatest mentioned group of God’s people in the Old Testament are the God-fearing Israelites (Jews) who put their trust in the Father and the coming Messiah, who they knew would be called Christ, which they awaited. Though of course they did not know Jesus personally in their earthly lives because they lived and died before His earthly arrival. The Jews who sinned would make animal sacrifices as temporary atonement that was made complete later by the sacrifice of Christ. So He lead them and all His people out of the Paradise side of Underworld into Heaven once He preached to them the gospel of His suffering, death, and resurrection. But it’s not up to us to judge who is/was considered righteous or unrighteous. Aside from the places and people described in Scripture, which mostly takes place in the Middle East, we don’t know what went on in other parts of the world and who the true God was worshipped by. Thankfully, we know God is perfect and just in all His decisions.
In Isaiah 45:22 it says “Turn to Me and be saved, all the ends of the earth;
For I am God, and there is no other.”
And 1 Timothy 2:3-4 says “ This is good, and pleases God our Savior, who wants all people to be saved and to come to a knowledge of the truth.”
We can see that both before (Isaiah) and after (Timothy) the first coming of Christ, God has desired all to be saved that will humble themselves, turn from their wicked ways, and worship Him. We can trust that any people He wished to have mercy on before the coming of Christ were also lead by Christ to Heaven if they followed God to the best of their ability and resented & repented of sin in their lives on earth.