"Sin, righteousness and judgment" refer to the threefold process found throughout the Bible. It is seen typologically in a number of key ways.
Firstly, it is seen in the "three-decker" primeval world: the Garden Sanctuary (Adam), the Land (Abel/Seth), and the World (Noah).
Secondly, it is inherent in the three-decker architecture of the Tabernacle: the Most Holy contained the Laws of Moses (conviction of sin); the Holy Place contained furniture which imaged the blameless nearbringing sacrifice (blood/Table + fire/Lampstand + smoke/Incense altar = righteousness); the Court (blood and water = judgment). This construct is a miniature of the primeval world.
Thirdly, it is seen in the threefold offices of priest, king and prophet, which correspond to the three furnitures in the Holy Place. The priest makes offerings for sin against the Law, the king serves in the light of the Law, and the prophet speaks the Law.
Priest: God's face is against Adam until blameless blood is shed (Showbread).
King: God's face shines upon Adam (Lampstand).
Prophet: As a priest-king, Adam speaks as God's face (Incense Altar).
You might also notice that a priest deals only in judgment upon animal substitutes, a king judges human lawbreakers, but a prophet proclaims the end for entire nations and empires.
In the New Testament, Jesus paid for sin in the Garden, the "firstfruits" apostles proclaimed His righteousness and resurrection to the kings of the Land (leading to AD70 and the avenging of the blood of Abel), and the Church now carries their doctrine to the entire world, leading to the final judgment.
So the threefold process applies to individuals and also to nations. In individuals it is the process of hearing (faith: they do not believe in me); seeing (obedience: I go to my Father) and speaking (legal witness: the satan/prosecutor stands condemned).
Also, the process aligns typologically with Genesis 1:
Priest: Days 1-3 - FORMING (dividing light from darkness, etc.)
King: Days 4-6 - FILLING (beginning with the governing lights)
Prophet: Day 7 - FUTURE (entering into God's rest)
Jesus, as priest, king and prophet, is the entire creation in human form.
Finally, the causal connection between Jesus going to the Father and righteousness is that after He fulfilled the priestly office of atoning for sin, He ascended to rule as king in righteousness (Revelation 4-5 shows Him ascending as the "firstfruits lamb" and opening the New Covenant scroll - four gospel horsemen ride out into the Land). Notice that His kingdom really begins at Pentecost, where the tongues of fire correspond to the "seeing" of the lampstand. Jesus sat at the Father's right hand, as Joseph was Pharaoh's right hand man, and Daniel was Nebuchadnezzar's right hand man, with "all power."