The Jewish leaders brought Jesus before Pilate because they said their law would not allow them to put anyone to death. However, earlier in the same Gospel, they were planning to stone a woman caught in adultery. Wasn’t this a death sentence?
The earlier incident occurs in John 8:1–10. The second one appears in John 18:28–32. Regarding the woman caught in the act of adultery, the procurator was perhaps not in Jerusalem then. That may also have been the case when a group of Jews stoned St. Stephen to death outside Jerusalem (Acts 7:54–60).
Regarding the death of Jesus, the Roman procurator (Pontius Pilate) was already in Jerusalem for the feast of Passover, the most likely time for any insurrection. Jewish authorities did not dare to execute Jesus while Pilate was in Jerusalem.
The Romans reserved capital punishment to themselves in order to demonstrate their control of a conquered people. Even so, that law could not be enforced in all places at all times.