Barry Town United beat The New Saints 2-0 in Bridgend to lift the Nathaniel MG Cup for the first time in 26 years.