Roma to Bari the train is the best, about 5 hours. Go, business class, Very lovely.
Bari to Amalfi is not going to work.
You go Bari to Naples and stay in this hotel for the night Starhotels Terminus 5 star.
Then get a tour bus to Amalfi Coast. 10-hour day. They will pick you all up at this hotel. Lots of stops, free time. Pictures.
Stay another night or two at the Starhotel Terminus and do Pompeii and Herculaneum