In John 12 when our Lord Jesus spoke of the ruler of this world (i.e., Satan) being cast out, there's more info He gave later in the Book of John about that event...
John 14:30
30 Hereafter I will not talk much with you: for the prince of this world cometh, and hath nothing in Me.
KJV
That's the another part of His info that goes with what He said back in John 12:31-33. Our Lord Jesus showed that He would leave this world (ascend to The Father after the crucifixion), but the "prince of this world cometh", and has nothing to do with Jesus. So basically, The Lord going away, and Satan coming to earth instead, was His Message there. And He gave that after... the John 12 verse according to John's timeline in The Gospel of John.