Saint Paul suggests that the righteousness commanded by God in the old testament is genuine righteousness when offered from a humble and contrite heart. This applies both to the old testament saints and to new testament saints. It is not righteousness that is critiqued by saint Paul, it is the pseudo-righteousness that comes from circumcision and membership in fleshly Israel along with the racial pride that accompanied it that saint Paul seeks to eviscerate. As saint Paul says, the Law is just and good. He has not desire to destroy it, nor did Jesus, our Lord, but he wants obedience that comes from the heart rather than outward sacrifice as the prophet said YHWH wanted.
And Samuel said, "Has the LORD as great delight in burnt offerings and sacrifices, as in obeying the voice of the LORD? Behold, to obey is better than sacrifice, and to hearken than the fat of rams. 1Samuel 15:22 RSV-CE
Guard your steps when you go to the house of God; to draw near to listen is better than to offer the sacrifice of fools; for they do not know that they are doing evil. Ecclesiastes 5:1 RSV-CE
And as the Lord Jesus said, in a parable:
But what think ye? A certain man had two sons; and he came to the first, and said, Son, go work to day in my vineyard. He answered and said, I will not: but afterward he repented, and went. And he came to the second, and said likewise. And he answered and said, I go, sir: and went not. Whether of them twain did the will of his father? They say unto him, The first. Jesus saith unto them, Verily I say unto you, That the publicans and the harlots go into the kingdom of God before you. For John came unto you in the way of righteousness, and ye believed him not: but the publicans and the harlots believed him: and ye, when ye had seen it, repented not afterward, that ye might believe him.
Matthew 21:28-32 KJV