A bike on the train out of Cardiff Central at 6pm would be a struggle, they’re not the most bike-friendly station! If you’re on across bike I’d be tempted to ride there and back, depending on the amount of time you’ve got available. Might even work out faster depending on the train times. The trails are doable on a CX/rigid but best to have a good knowledge of what’s coming up.
As for night riding at Cwmcarn, do it 4 or 5 times a year. Surprising how often I see others out too! If you decide to drive, the Forest Drive entrance will be locked but you can nip into the visitor centre car park via Cwmcarn village easily enough.