The two men, aged 18 and 20, were killed along with a Portuguese man when they were crushed by the train in the northern Portuguese town of Maia on Monday night.
The two Spaniards, who came from Madrid, were killed while graffitiing a stationary train carriage, confirmed firefighters who attended the scene in the town, around 100km from the Spanish border.
The three were said to be with another two graffiti artists who were uninjured and fled the scene.
The incident happened at around 8.45pm on Monday evening while the group were painting a stationary carriage in Águas Santas station.
They were hit by an oncoming train travelling between the stations Campanhã, in Oporto and Ermesinde.
Two of the three were dragged for a distance of around 200 metres by the train, reported Portuguese newspaper Jornal de Notícias, while the other man was hit and thrown onto the side of the tracks.