Actually, in Spain, we had to go through a metal detector to get on train from Sevilla to Madrid. Security wasn't as tight as for airplane boarding, and was very quick, but I was very surprised to find it there at all.
This is really important if you think that we do have an in active terrorist (or political liberation, according to some) group in Spain, which targeted those trains in the past.