Do you think that there is perhaps consistency of Scripture when it comes to the definition, or is the definition of "righteous" fluid throughout the Bible?
Again, in the Romans 3-5 context the subject is "the righteousness of God" - Rom. 3:22. All fallen mankind have "come short" of that standard, which is "the glory of God." Here is where the fly in the ointment occurs. The righteousness of God is ABSOLUTE SINLESS PERFECTION with regard to both the PERSON and the WORKS of God. There is no separation between His PERSON and His WORKS. This righteousness is "THE GLORY OF GOD" and it is to be "perfect EVEN AS your Father in heaven IS PERFECT." It is not to fail even in ONE POINT of the Law, as to fail even in ONE POINT is to fail to be "perfect EVEN AS your Father in heaven IS PERFECT.
Paul's verdict is that there "IS" none righteous according to that standard with regard to their PERSON and there is none that can "DO" righteous according to that standard. There are no ABSOLUTE SINLESS persons and therefore there are none who can DO absolute sinless works.
Paul's verdict is "all have sinned and come short of the glory of God" which denies that any fallen man can ever achieve that in his own person or life because he has already failed to be "perfect EVEN AS" God is perfect. God has never sinned in his past, never sins in the present, and will never sin in his future. God has no need of forgiveness and anyone who has need of forgiveness has already "come short" and that is proof they are not "perfect EVEN AS" God is perfect in their own person and life.
This is why all the sacrificial victims must be "without spot" to represent their WHOLE LIFE is ceremonially SINLESS.
Abraham is set forth as the example of "ALL WHO ARE OF FAITH" meaning all who are justified by faith. Abraham was "justified" - Aorist tense completed action while he was in the "uncirumcision" aspect of his life (Gen. 11-16) and not in the "circumcision" aspect of his life (Gen. 17-24). Hence, the only possible kind of "justification" of Abraham is one that has no bearing upon how he lived his own life, or upon his own works or upon his own faithfulness, because the greater part of his life was "in circumcision" which Paul eliminates/denies as the period when he was justified - "NOT IN CIRCUMCISION" (Rom. 4:9-11).
Moreover, it is the state or condition of being "ungodly" when Abraham was justified. Ungodly means not like God, thus not like the "righteousness of God" thus not sinless, thus not "perfect even as God is Perfect" with regard to both person and deeds.
Furthermore, it is Abraham's "faith" that was "counted" or "reckoned" for righteousness. Paul did not say it was his "spiritual union" or being "in Christ" or being "born again" or being "quickened" that was reckoned or counted for righteousness. All of these are common terms used by Paul which he could have used here if that was what he meant, but he did not use them because that is not what he meant.
Moreover, spiritual union, new birth, quickening does not change the actual condition of Abraham or his works to be sinless, righteous or perfect even as God is perfect. So Abraham was not MADE righteous "before God." Glorification is the work that MAKES Abraham righteous before God. Spiritual union does not MAKE Abraham righteous before God. That is why those who believe Justification is spiritual union also must make the justificaiton of Abraham a "continous" action in both "uncirumcision" and "circumcision" when Paul makes it a COMPLETED action in "uncirumcision." Those in spiritual union with Christ still sin and therefore they are not "MADE" righteous with regard to either their person or works.
Paul did not say this completed stated of justification (Aorist tense) was IMPARTED by faith but was IMPUTED by faith. Paul makes it clear at the very end of this dissertation on justification that justification was obtained by faith "IN" the person and works of Christ rather than by "BEING IN" Christ through regeneration or spiritual union.
Spiritual union or being spiritually "in Christ" does not change the condition of Abraham or his works, or your condition or your works from sinful to sinless. Hence, being "in Christ" does not MAKE you sinless. The only aspect of your condition that is in spiritual union with Christ is your new inward man and that only provides the source and power to progressively overcome sin.
However, Abraham at the point of faith in the gospel (Gal. 3:8) was DECLARED TO BE RIGHTEOUS before God based upon a substitutionary representative person and works (life) of Christ acting in his behalf "for" him. It had to be imputed because it was an ALIEN righteousness to his own person and works which were "ungodly" and thus it is the "ungodly" who are justified by faith or declared to be righteous by faith when in fact their own condition is "ungodly" and remains "ungodly" until glorification - "ungody" = not in a personal condition of sinless perfection like unto God.