A security guard at the Castelldefels railway station near Barcelona died this morning after being attacked by a troublemaker.