They were among the top teams as squads from across Neath Port Talbot and Bridgend battled it out for a place in the grand finals of the Railway Safety Cup.
The competition, organised by British Transport Police (BTP) and supported by Network Rail, saw teams from comprehensives take to the pitch.
Winners of the regional heat, at Swansea’s PlayFootball complex, were Bridgend’s Brynteg School.
They will be joined in the finals on June 18 by runners-up Dyffryn and by semi-finalists Cymer Afan and Glanafan.
All four will compete against teams from Swansea, Cardiff, Newport and Rhondda Cynon Taf for the honour of being crowned South Wales champions.
The aim of the event is to promote alternative activities for young people to discourage them from trespassing on railways.
During the tournament, supported by the Football Association of Wales and water firm Brecon Carreg, each team of Year 8 pupils received an interactive safety presentation from Police Community Support Officers.
Inspector Mike Edwards, in charge of BTP’s Welsh neighbourhood policing teams, said: “The Railway Safety Cup is in its fourth year and the response from schools has been outstanding.
“Not only does it allow pupils to take part in the football competition, it also gives us an opportunity to raise awareness of safety within the railway environment and the inherent dangers of trespass.
“It was extremely pleasing to see that the rail safety message had a positive impact on the youngsters.”
Network Rail took their Safety 365 bus to the Swansea event and pupils were able to learn about the railway environment and put their knowledge to the test.
Goodie bags were presented to the school that scored the highest in a series of railway safety quizzes.
PCSO Kim Livingstone said: “It was an excellent day. The players asked some pertinent questions during the safety presentation and the feedback from teachers was positive.
“Congratulations to the four sides that progressed through to the grand final, which promises to be a memorable day.”
Photo Sergeant Steve Dawkins who was on medal presentation duty at the Swansea Railway Safety Cup event.