She was.
Isaiah 53:6 All we like sheep have gone astray;
we have turned every one to his own way; and the LORD hath laid on him the iniquity of us all.
Romans 3:10 As it is written, There is none righteous, no, not one:
11 There is none that understandeth, there is none that seeketh after God.
12 They are all gone out of the way, they are together become unprofitable; there is none that doeth good, no, not one.
So St. Paul's words are not cut-and-dried chess pieces - he is teaching something rather complex. He claims that righteousness is an external appellation and also an innate quality. This tension is there throughout his letters. He speaks of those who do righteous deeds, and then he claims that no one has done righteously.
I note that you do not quote other passages in the Bible where Phineas is considered righteous, and others, specifically kings like Hezekiah are acknowledged as upright.