Personally I would book the train in advance if it's not on the same day as your arrival to Naples. you know what you are paying then.
I went to Rome via Naples, we looked at going to Pompei but couldn't fit it in with our flight schedule unfortunately - so I can't help on that front; does...