Is there a train that goes from the Herculaneum ruins to Rome (preferably Termini)?
Yes, via Naples or Salerno.
Note if you come to Ercolano on the Circumvesuviana commuter train, you will be switching to the Trenitalia line, but it probably makes no difference if you switch there or at the Naples or Salerno train station--just be aware that there are two train lines.
The Circumvesuviana does not go to Salerno. To get to Herculaneum from Rome you need to take the Trenitalia train to Naples and then switch to the Circumvesuviana. Both trains use the same station in Naples.
No direct train. You take the Circumvesuviana train to Naples and then head upstairs from that platform to the main floor platforms to catch a train to Rome.
Thank you much for this information