James 5:16 The prayer of a righteous man avails much...
Rom 3:10 There is no one righteous, not even one.
The critic asks: Who's going to pray that James 5:16 prayer, if no one is righteous?
The answer is clear when the contexts of these statements are considered. In the Romans passage, St Paul is reaching the climax of his argument in chapters 1-3, that man on his own is not righteous before God, that Jew and non-Jew alike are not worthy on the basis of their works and merits to be justified before God.
In this sense St Paul says that nobody is righteous. Yet Paul goes on to show that through faith in Jesus Christ, God-Incarnate, we are justified and therefore righteous in God's eyes. That is the glorious theme that pervades the epistle to Rome.
In the James passage, the context indicates that the man making the prayer is indeed justified and in the Church, that is, he is righteous -- justified in God's sight. St James in 5:7 refers to the readers as adelphoi , brothers in the faith.
These addressees are indeed righteous through faith in Christ, hence St James is justified with his comment in 5:16. Yet at the same time, on their own merits alone [a la Romans 1-3] the addressees are not righteous.