Look out across the racecourse from the left side window when on a Chester - North Wales train and you can see Chester Castle.
And of course the cathedral is visible on the approach from North Wales (from soon after Queensferry).
Flint castle is close to the station (not much left of it).
Caergwrle castle (also not much left) is on the Bidston-Wrexham line - the station used to be called Caergwrle Castle and Wells.
Gwrych castle near Abergele (I'm a Celebrity) is visible from the coast line if you know where to look, although it is set against a hill.
There's a glimpse of Beaumaris castle from the line near Llanfairfechan.
Stokesay Castle is next to the railway near Craven Arms.
Another difficult one to see is Powys castle near Welshpool, also set against a hill when viewed from the railway.
You won't see Chirk castle from Chirk, as it's lost in hills and dense woodland.
Shrewsbury station is built right under the walls of Shrewsbury castle, also the case in Lancaster and Carlisle.
Nottingham castle is prominent in the railway view from the west.
I've never visited Northampton except on WCML diversions, but the station used to be called Northampton Castle which is a hint.
Lichfield cathedral is a landmark on the WCML with its double spire.
You can glimpse Manchester cathedral from the Salford-Victoria line, but most of the view is now blocked by towers.
Lincoln cathedral can be seen from many miles away on the lines radiating from the city.