Then Judas, which had betrayed him, when he saw that he was condemned, repented himself, and brought again the thirty pieces of silver to the chief priests and elders,
Note 1 at Mt 27:3: The placement of Judas' death in this chronological sequence could be questioned. Matthew was the only writer to mention it, and he placed it in between the religious trial and the civil trial of Jesus. So Judas could have regretted his actions after he saw that Jesus was condemned by Caiaphas, before He was brought before Pilate.
However, Matthew also mentioned that Judas went to the chief priests and elders in the temple and admitted his sin, and that would suggest that the time was later in the day, after the civil trial of Jesus.
Note 2 at Mt 27:3: The Greek word used for "repented" here is "METAMELLOMAI" (compare with note 1 at Mt 3:2), and it is used in the passive voice expressing regret rather than true repentance. Judas regretted that Jesus was condemned (see note 2 at Lu 22:3), but it is certain that this was not the type of repentance that brought him back into right standing with God (see note 2 at Mr 14:21). This is an example of the sorrow of this world that produces death (2Co 7:10), not the godly sorrow that gives life.