The Marquis of Bute bought the Glamorganshire and Aberdare Canals in 1885, in order to close them both and build a railway to crush the Taff Valley Railway’s near monopoly of the railways and their transportation of coal to Cardiff. An Act was passed in 1897 and the Bute Docks Company became the Cardiff Railway Company. The railway was given powers to construct a railway commencing (by a junction from the Rhymney railway) at the Heath to Pontypridd, with a branch connecting with the TVR south of Treforest.
Construction of the railway started in 1898 from Heath Junction to Tongwynlais via Coryton. Then the line was extended to Treforest with the view to link with the TVR line at Pontypridd. The TVR blocked this final stage with the purchase of a strip of land between their main lines and an embankment owned by the Cardiff Railway leaving the latter no option other than to run a passenger service instead of freight to Rhydfelen. In fact only one revenue earning train ever crossed the 512 foot viaduct at Rhydfelen to Treforest, in 1909. The viaduct at Rhydfelen was one of eight bridges built on a skew, it had big masonary abutments at each end and piers made from cast iron cylinders filled with concrete which were sunk into the river bed. Both the piers and abutments still survive today, despite the actual viaduct being taken down in 1943.
Amongst some of the other engineering challenges that faced the Cardiff Railway was a 324 foot tunnel between Tongwynlais and Taffs Well which quite easily could have been a cutting instead?
The first public passenger service started on 1 March 1911, from Cardiff to Rhyd-y-Felin (as it was known then) using a steam railmotor. Stations were built at Heath, Rhiwbina, Whitchurch, Coryton, Glan-y-llyn, Nantgarw, Upper Boat and Rhydfelen. There were goods sheds at Whitchurch and Glan-y-llyn and cattle pens at Upper Boat and Glan-y-llyn (which still survives today). Some of the stations were built with wide spaces between the up and down platforms for the provision of through freight lines, which never happened. There were also signal boxes at Whitchurch, Tongwynlais, Glan-y-llyn and Upper Boat.
Following the decline of steam coal after the grouping of 1922 (Cardiff Railway became part of the GWR) and poor profits, the line between Coryton and Rhydfelen was reduced to a single line in 1928 and closed in July 1931. The junction at Treforest never materialized even under GWR ownership as the decline in coal meant that the old TVR route was more than able to handle the volume of freight. However things were a little different south of Coryton, such that with fairly high levels of commuter traffic a new station was opened at Birchgrove in 1929.
In 1938 part of the freight line as far as Nantgarw Colliery re-opened but that was finally closed in 1953 when a new junction from the TVR line was installed. The final part to Nantgarw Colliery from Taffs Well was still being used up until about 1987, when the colliery itself closed.
Coryton station is now the end of the line, the other stations being Whitchurch, Rhiwbina, (Ty Glas added in the 1990s), Birchgrove and Heath Low Level.
It is still possible to walk along the rest of the line to Coryton roundabout, from Coryton station. The trackbed takes you under many impressive bridges, including a three-tier mini viaduct and single-arch bridges all lying within heavy woodland. The line then disappears under the A470 (Tongwynlais tunnel and station would have been here) and M4. But, it is possible to carry on following the line from Taffs Well (Glan y Llyn station survives as a private dwelling) all the way to Upper Boat, where it then disappears under the A470 again as far as Rhydfelen. Much of the trackbed between Nantgarw and Upper Boat lies in Treforest Industrial Estate, but can be followed. Parts of the viaduct at Rhydfelen can still be seen too and it is possible to work your way to Treforest itself after the river, although a bit tricky.