Note: Revised, following clarification of the question, (intend to provide more references).
Outline: (1.) Question Restatement (2.) Answer (3.) Greek Analysis (4.) Explanation
1. Question Restatement
In John 16:10, it speaks of Justice and Judgment in relationship to Jesus returning to the father -- How is that a part of justice?
NASB, John 16:7-11 - 7 ... for if I do not go away, the Helper will not come to you; but if I go, I will send Him to you.
8 And He, when He comes, will convict the world concerning sin and righteousness and judgment; 9... and concerning righteousness, because I go to the Father and you no longer see Me;
2. Answer
Because is implying a necessary correlation, and collaboration, and doesn't imply that going to the father was -- by itself -- "righteousness":
Because Jesus would soon be fulfilling his role before the father -- then the Holy Spirit could fulfill his appointed role regarding righteousness -- on Earth.
That is, the two are going to fulfill their roles in parallel -- only because they will be doing it together.
"*The agreement is that we must act together; therefore you can act, because I am acting, and in agreement -- because, we cannot act separately, [analogous to parental rights]."
The Holy Spirit could now fulfil his role to instruct and convict -- because Jesus would also be fulfilling his role -- working together, as prophesied.
Together, these two roles facilitate justice: as an advocate to instruct and convict -- and an advocate to defend to pursue mercy -- justice demands both.
Jesus' statement was actually in reference to many prophecies concerning him, and the Holy Spirit -- which would be fulfilled in this.
3. The Greek
The text says that the role of the Holy Spirit is as a "Helper, (παράκλητος)" -- which means "advocate", or an "attorney" in this context.
Greek Usage in the New Testament:
1 John 2:1 N-AMS Biblehub.com link
GRK: τις ἁμάρτῃ παράκλητον ἔχομεν πρὸς
NAS: we have an Advocate with the Father,
Given the context of "Justice, Judgment, and Sin", translating "Helper" as "Advocate" brings clarity to what Jesus is speaking about.
Usage outside of the Bible:
Eusebius, History of Church, Book 5:10, (Greek, English): - But those about the judgment seat cried out against him, ... he, confessing this with a loud voice, was himself taken into the order of the witnesses, being called the Advocate of the Christians, but having the Advocate in himself, the Spirit more abundantly than Zacharias.
4. Explanation
The Holy Spirit As Advocate, (Helper):
God prophesied that The Holy Spirit would be given this role to fulfill on earth -- to expose the judgments of men, what is just, what is sin -- to vindicate his own name:
Ezekiel 36:22 - “Therefore say to the house of Israel, ‘Thus says the Lord God, “It is not for your sake, O house of Israel, that I am about to act, but for My holy name, which you have profaned among the nations where you went.
23 I will vindicate the holiness of My great name which has been profaned among the nations, which you have profaned in their midst. Then the nations will know that I am the Lord,” declares the Lord God, “when I prove Myself holy among you in their sight.
27 I will put My Spirit within you and cause you to walk in My statutes, and you will be careful to observe My ordinances.
Jesus as Advocate, Helper:
Scripture speaks of Jesus as an "advocate" for people--before the father.
NASB, 1 John 2:1 - My little children, I am writing these things to you so that you may not sin. And if anyone sins, we have an Advocate with the Father, Jesus Christ the righteous;
Because -- even from the Garden, God taught that mercy triumphs over judgment -- that the advocacy of one person for another -- supersedes condemnation under the law.
NASB, James 2:13 - For judgment will be merciless to one who has shown no mercy; mercy triumphs over judgment.