That word righteous is the greek word dikaios and means:
I.righteous, observing divine lawsA.
in a wide sense, upright, righteous, virtuous, keeping the commands of GodI.
of those who seem to themselves to be righteous, who pride themselves to be righteous, who pride themselves in their virtues, whether real or imagined
ii.
innocent, faultless, guiltless
iii.
used of him whose way of thinking, feeling, and acting is wholly conformed to the will of God, and who therefore needs no rectification in the heart or life
a.
only Christ truly
iv.
approved of or acceptable of God
B.
in a narrower sense, rendering to each his due and that in a judicial sense, passing just judgment on others, whether expressed in words or shown by the manner of dealing with them
Christ's commandment keeping while he was here in the flesh is imputed to them as a free gift, and God charges each of them with keeping His Commandments as perfectly as Christ Himself did ! So they are Righteous !