Speaking on BBC Radio Wales, the prime minister said the rail electrification would make the service "world class".
He said it would also be a greener and more reliable rail link.
'Railways are back'
"It just shows that railways are back and that the investment in railways will pay off for the future," Mr Brown said.
As well as the cabinet meeting, ministers also took part in a series of meetings and events throughout south Wales.
Lord Adonis told the BBC the massive railway investment involved would be worth it.
He said: "With the electric trains you get a quieter, cleaner, more reliable and much cheaper train which benefits passengers and it also benefits the taxpayers because it's much cheaper to keep an electric railway going.
He also said the investment would pay for itself over a 40-year period and that there would be no impact on fares.
It is the sixth time Mr Brown's cabinet has met outside London, since it began a tour of locations around the UK last September with a visit to Birmingham.
Trips to Leeds, Liverpool, Southampton and Glasgow followed, before this visit to the Welsh capital.
At a question and answer session for several dozen youngsters at the Millennium Stadium, Mr Brown sang the praises of a young entrepreneur who uses rap music on MP3 players to teach GCSE courses.
Nathan Dicks, 25, is hoping that top-level political backing will help transform his fledgling company into a potential world-beater.
With an unscripted question Mr Dicks grabbed Mr Brown's attention by asking for his backing in rolling out his music education scheme across the UK.
Mr Brown agreed to take a closer look at the ideas behind his company with a view to giving it a boost.
Mr Dicks's Cardiff-based company, called Re-Wise Learning Ltd, seeks to turn an obsessive interest in music among teenagers into a learning tool.
A key part of GCSE syllabuses are put to music in the belief that youngsters will learn crucial lessons while doing anything from revising, watching TV to walking down the road.
Mr Dicks briefly outlined his scheme to Mr Brown as a smile broke across the prime minister's face as the details emerged.
He urged Mr Brown to help, saying: "If you heard any of the music that you listened to when you were 14 you would remember the lyrics without having to try."
Mr Brown said: "Let's get the details of it to see what we can do." He added approvingly: "He's very entrepreneurial isn't he?"
Shadow Welsh Secretary Cheryl Gillan said: "The prime minister has barely visited Wales since he took office - and since Conservatives beat Labour in Wales at last month's European elections we're surprised he wants to come at all," she said.
"This is a shallow attempt to pretend that Wales matters to him.
"If Gordon Brown thinks (the) visit will persuade people to forget that Labour is to blame for the difficulties facing Wales today then he will be very disappointed."
Welsh Liberal Democrat leader Kirsty Williams described the event as stage managed and said it would not "replace real engagement with Welsh communities and meaningful reform of our damaged democracy".
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.