We travelled from Sorrento to Pompeii this time last year, the train was rammed, a bit like the pre-match Falmer train. Not always reliable, and Pompeii takes a long time to get around, temperature will be in the low 30's.
I would suggest stay in Naples, but keep your valuables in a bumbag...