I agree with you with regard to convenience, but what about security? For the application of railway station lockers, one can assume that they will be under CCTV or other monitoring. I am no expert in locks, but presumably an electronic lock, whilst perhaps less secure overall, is harder to break without obviously looking like one is tampering with it. This is in contrast to a conventional barrel lock, which can be picked with tools that look enough like keys not to arouse suspicion from a distance.