Careful attention to the context of James 2 proves that James is thinking of demonstrations of righteousness. Here are a few lines of evidence.
1. James 2:21 says, "Was not Abraham our father justified by works when he offered up his son Isaac on the altar?" The timing of Abraham's justification by works is important. Abraham was first justified by faith in Genesis 15:6, where we're told, "And he believed the LORD and it was counted to him as righteousness." But, Abraham's offering up of Isaac doesn't occur until Genesis 22. So, James is not saying that Abraham was justified by works when he first believed, but only when his initial justification was later evidenced by the works of faith. Abraham's works were demonstrations of a previous justification.
2. James 2:22 says, "Faith was completed by his works." But, what does it mean that "works" complete "faith?" This same Greek word translated "complete" is used in 2 Corinthians 12:9, where God says, "My power is made perfect (completed) in weakness." God can't be saying that His power only truly becomes power in weakness. Rather, He is saying that His power is evidenced in our weakness. In the same way, our faith is evidenced, or completed, by our works. James is talking about evidence in this passage; so, he must be using the word "justified" differently than Paul.
3. The second chapter of James uses a number terms that mean "demonstrate." James says, "show me your faith" (James 2:18), "I will show you my faith" (James 2:18), "Do you want to be shown" (Jas 2:20), "You see that faith was active" (Jas 2:22), "You see" (Jas 2:24). Since the theme of the passage is "showing" and "seeing," it makes most sense to read James' understanding of the word "justified" in that light.
4. It is clear from other passages that "demonstration" is well within the range of the meaning of the word "justified." For example, in Matthew 11:19, Jesus says, "Wisdom is justified by her deeds." It would make no sense to interpret that verse to mean "Wisdom is made to be wisdom by her deeds" or "wisdom is constituted righteous by her deeds." Instead, Jesus is saying that "wisdom is evidenced/demonstrated to be wisdom by her deeds."
In conclusion, Paul and James are using the word "justified" in two different senses. Paul is talking about what makes us righteous before God (Christ alone by faith alone), while James is talking about what proves our righteousness before God (faith working through love).