In the Spanish Bible, I believe the English "justice" and "righteousness" are both translated as justicia. Is justicia the only word that can translate both of these terms? Is there any way to know which is intended other than through context?
In Spanish you have adjective justo, which primary meaning is fair, just or righteous, and noun justicia. One of the meanings is having these qualities.
In English you have 3 nouns: justice, righteousness and fairness. They are synonyms, although the context in which they are used varies.
Now, for justicia as righteousness, indeed you can only know from the context. However, that usage is quite uncommon. The only one I can think of is hacer algo con justicia, which would be translated to: to do something righteously. Again, let me stress that it's not very colloquial, so you won't hear that in every day conversation.