It depends on what you mean by “necessary”.
Often we say something is necessary, we imply causality. Because we need A, B needs to happen. A causes B’s necessity.
We also implies temporal causality, for the most part, namely: because we already planned to have A, so later we facilitate or wait for B to happen to accomplish A.
This is not how it works in Judas’ case for two reasons: God does not work in time, He is outside of time’s constraints; and God did not make, ask or even suggest Judas to betray Him. It was entirely his free choice.
In short, it is absolutely possible for Judas not to choose to betray Jesus. We can be certain about it because more than once Jesus said that it would have been better for the one who betrays the Son of Man not to have been born. It was really a great evil that Judas has voluntarily chosen, not according to God’s will of good on all souls.
What happened instead, was that God being outside of time, as if one looking from a different dimension onto the entire timeline, saw in one instance when he thought of sending His Son among us, what is to happen in all time moments. Particularly, He saw outside of time the free choices of Judas. He also saw the free choices of the chief priests and scribes and Pharisees, and the unbelief of the people.
It is because of our free choices, including Judas’ in question, that God could design a plan to make the best out of it through Jesus’ life, suffering, death and resurrection, all the preparation prophecies in the Old Testament leading up to Jesus, and every other plans of salvation He has in store for us all, across all time. No, God’s plan of Jesus’ death and resurrection did not cause Judas’ betrayal; it is the choices we all make that necessitated God to send Jesus among us, to die for us, and to rise for us so that we may be saved.