How best get from Sorrento to Matera and return to Rome?

Hi community. We are a couple and planning a travel from Sorrento to Matera (2 nights there) and then go to Rome this September. Does anyone have a valid experience of doing that trip? I will appreciate advice:

1. Is there any public transport option that is convenient for such itinerary?

2. If we rent a car in Sorrento:

- online search shows around 3.5hrs drive from Sorrento to Matera - is it so, or we should plan for longer? Is the road difficult to drive (I've driven on Amalfo coast)?

- is it wbetter to return the car in Matera and take public transport to Rome? Driving shows me above 6hrs (so does public transport) and I don't like to "kill" our vacation time on that.

Thanks for ideas!