Job knows his righteousness can be defended by a heavenly witness before God. We know this to be true because Jesus Christ is the both our heavenly witness who is both our defense attorney and the one who makes us righteous. Yet, in this world, those who have given themselves over to their sin and argue against God falsely believe themselves to be righteous and all believers to be wicked despite them holding to God's law. Job experiences this with his friends and we experience this with people who reject the scriptures. But we persist in our struggle of faith with our Lord, pleading with Him to hear and deliver us, not because we believe ourselves to deserve it from being righteous but because we know we need our Lord.