It's a massive plot hole in the NT, that a person whose mission can only be fulfilled by a death/resurrection cycle (to the extent of making sure none of his other allies prevented the death, nor making even a cursory attempt at defence in either of the two trials) would regard Judas as a betrayer.
And yet, he is named as such even before the deed. Although, looking at this text, I assume a wild mistranslation happened somewhere and that the original word which became "betray" had a much more general sense of causing harm rather than violating trust or confidence:
> After he received the piece of bread, Satan entered into him. Jesus said to him, “Do quickly what you are going to do.”