That was before Jesus...God called them righteous through their Godly faith in Him. Faith has been the key to salvation in both the old and the new covenant (Jesus).
READ ROMANS CHAPER 4,,.Here is a few lines:
13It was not through law that Abraham and his offspring received the promise that he would be heir of the world,
but through the righteousness that comes by faith.
16Therefore,
the promise comes by faith, so that it may be by grace and may be guaranteed to all Abraham's offspring—not only to those who are of the law but also to those who are of the faith of Abraham. He is the father of us all. 17As it is written: "I have made you a father of many nations."[
c] He is our father in the sight of God,
in whom he believed—the God who gives life to the dead and calls things that are not as though they were.
20Yet he did not waver through unbelief regarding the promise of God, but was strengthened in his faith and gave glory to God, 21being fully persuaded that God had power to do what he had promised. 22This is why "it was credited to him as righteousness." 23
The words "it was credited to him" were written not for him alone, 24but also for us, to whom God will credit righteousness—for us who believe in him who raised Jesus our Lord from the dead. 25He was delivered over to death for our sins and was raised to life for our justification.
ALL OF THEM HAD FAITH AND IT WAS COUNTED TO THEM AS RIGHTEOUS....So you are right they are counted righteous, but you left out why...IT IS NOT BECAUSE THEY WERE GOOD (THEY ALL WERE SINNERS),
IT IS BECAUSE OF THERE FAITH IN GOD.