Spain, too, has x-rays for larger luggage but no metal detectors.
But this is just a lower level of security theater. They only do it for long distance trains because it would be completely unworkable on commuter trains or a metro. But long distance trains make for bad terrorist targets, even at full capacity the people-density is relatively low and the seats are sturdy and so you're unlikely to kill many people. Unsurprisingly the attack that killed 200 people was on rush hour commuter trains.
There are so many soft targets -trains secured? On to busses, cinemas, Walmarts (especially on Black Friday), elevator banks or the $&$%/& security lines in front of them when you do start to deploy scanners- and so many more ways to attack targets that aren't quite as easy (tunnels are a prime target if you want to scare drivers, anything carrying toxic crap, etc.), it's completely pointless.
Airport security makes a certain amount of sense because tiny amounts of explosives can kill hundreds of people and using the aircraft as missiles can kill thousands, as do checkpoints for specific high profile targets (Congress), everything else is stupid.