In the short-distance trains you can get into the train only by passing a card through a rfid reader. Maybe you should compare this trains to UK ones.
Thus, Spain has less population than the UK, is less centralized than UK (where almost everything is in London) and Spain is much more mountainous. We can’t really compare these two countries.