You have ten people who are shipwrecked
A ship comes to rescue all ten.
5 decide the people on the ship were their enemy, so refused rescue
The other 5, decided they wanted to be rescued, and allowed the people to rescue them,
Salvation was offered to all 10 people. But only 5 were saved, Because they believed, The other 5 did not believe, so they were condemned already. But it was not the rescuers fault. The rescuer was found just and righteous even though the 5 died, Because the rescuer offered to save them also. But would not force them to recieve their gift.
Jesus offers salvation to the world. he came to rescue (the word save literally means to be rescued) the world. Who are in their own ocean, with no hope. With no ability to save themselves. Jesus as rescuer comes, But not everyone will be saved, because many refuse his offer. They consider him their enemy. But many others will recieve
Jesus is justified and found righteous in either case, because he offered salvation to everyone, he just did not force his gift on anyone.