We have left on cruises from Civitavecchia several times but have always arrived the night before. You'll need transport from the train station to the cruise terminal and it can be hectic on sail days, especially if there are multiple ship departures. There are transport options but lots of competition for them. You might look into arranging that section of your journey ahead of time. We have also used the Italian rail system on many trips, including a trip from Livorno to Florence and return in one day, which worked but was a little stressful because of how tightly it was scheduled. Your trip is longer. We have not had any problems with train travel in Italy but there is always a possibility of strikes, which show up at seemingly random times and last for uncertain periods. I would feel more comfortable with an extra day between the end of a tour and a sail date but if your dates are locked in, you might look into a backup and live with the uncertainty.
Bill