I don't think they are arguing with each other, though James may be correcting an antinomian misunderstanding/misrepresentation of Paul (I know Romans was written after James by a decade or more; however, Paul had been preaching the gospel of grace for a decade or more before James wrote his letter).
I think the key is to see that Paul and James are using the word 'justify' differently. DA Carson sums up my understanding well: "James is using the verb 'justify' in the sense 'vindicate before men'...and therefore James and Paul are talking about different things...Paul the declaration of our righteousness and James the demonstration of our righteousness."
I think there is good reason from the text to believe this. In Romans 4:1-3 where Paul argues that Abraham was justified by faith and not by works he points to Abraham's belief in God's promises. This belief was reckoned to him as righteousness. That event is recorded in Gen 15.
James says that Abraham was justified by his work of offering up Isaac on the alter (James 2:21). The event he draws upon is recorded in Genesis 22 and happened years after he had been declared righteous by God. In the next verse James writes, "You see that faith was active along with his works, and faith was completed by his works". The word completed is telos (ετελειωθη) and has the meaning of completed/perfected - not in adding what was lacking, but in bringing something to its completion/end/goal. So James is saying that Abraham was justified by his works, meaning he was proved to be righteous (not declared to be righteous; something God had already declared decades earlier). Also, James contends that his faith was brought to completion by his works. That accords with Paul's theology expressed in Eph. 2:8-10:
"For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, not a result of works, so that no one may boast. For we are his workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them."Faith saves, but the kind of faith that saves will be evident in our good works, works we were created to do in Christ Jesus.