Sometimes we can loose site of the fact that the gospels like all writing, while divinely inspired, shows the perspective of the human author. Each author paints a different portrait if Jesus. Were they meant to be mere dry historical accounts, why would God have inspired more than one?
This past Sunday we read Mark where Jesus is mostly the silent lamb. Today we continue to read John. For John Jesus is always on top of the situation. Even with his betrayal he gets the last word,
What you are going to do, do quickly
It is a command.
Taken out of context one could look at John's gospel and deny the existence of free will. The devil made him do it. But this is why we read the New Testament as a whole and do not simply cherry pick verses to suit us at the moment.
The point John is making is that on a higher level it all works out. While today each of us will make truly free choices, God already knows the choices we will make. And in the end even the bad choices can have good consequences. Judas set himself on the road to betrayal long before the night of the Lord's Supper. It was not simply a single choice It was the culmination of a series of choices.
The good news it that God could weave even that most evil of choices into the larger tapestry in such a way as make it part of the Good News. If he could do that with the evil of Judas, imagine what he can do in our world today,