How will the people who died, not knowing Jesus (like if they never heard of Jesus before they passed away), be judged?
I am reminded of the following verses when I read your question:
Romans 9:14-16
14 What then shall we say? Is God unjust? Not at all! 15 For he says to Moses,
“I will have mercy on whom I have mercy,
and I will have compassion on whom I have compassion.”[a]
My quick answer is that His nature dictates His action. Also He is sovereign and He will have mercy on whom He wants to give mercy. So it is not up to us to know what will happen to them but I am assured of God’s nature of mercy and compassion.