If you stop to visit the ruins and an overnight at Agrigento there is a direct bus route from Agrigento to Marsala on Auto Linee Lumia. I don't think Agrigento is feasible as a daytrip from Marsala by public transportation. It would even be a long day by car or private driver. Selinunte is much closer to Marsala. Personally, I liked the visit to Selinunte very much. it is expansive, uncrowded, with the ruins of multiple temples right next to the sea. From Marsala you can take a short train ride to Campobello de Mazara and then get a taxi from there to Selinunte. I stayed at Mazara del Vallo for two nights. It has a lovely picturesque historical center which has quite the mixture of Catholic, Arabic and Jewish influences. We took a short train ride from Mazara to Castelvetrano and then right there at the train station caught a local bus that dropped us off about two blocks from the entrance to the Selinunte archeological park. All very easy. i also travelled by bus from Mazara to Agrigento. Again easy to do and comfortable.
I did a 22 day trip around the island of Sicily a few years back mostly using trains and busses but we did hire a private driver on two occasions. Once to get from Agrigento to Piazza Armerina and on to Siracusa and a different driver to do some siteseeing outside of Palermo. Those days would just have been too difficult to see and do everything without a car and we did not want to drive.
We arrived and departed from Catania travelling counterclockwise around the island. From Catania we took the bus to Taormina. Busses were packed. Buy ticket at an office across street from the bus station parking lot. Lots of people travelling by bus but also lots of busses. Taormina,s bus station is actually in Taormina, closer to town. Train station is below on the coast. Taormina's bus station was also packed with people and hectic. We were there in September. Took bus from Taormina to Messina and then train to Oliveri to Cefalu to Palermo ( stayed in Palermo for a week and did daytrips from here to Erice, Marsala, Segesta and Monreale, Mondello and Borgetto). Train to Mazara del Vallo. Bus to Agrigento. Private driver to Piazza Armerina and Siracusa. Bus to Catania. All went well. Train and bus fares were cheap. Trains were not very modern and did not have any marquee in the cars announcing upcoming stops but I had researched the routes and knew where to get off. We simply bought our train tickets on day of travel right at station, often from the machine since some stations were unmanned. Needed to validate tickets on platform. Bus tickets were also bought on day of travel, usually at the tabacchi by the stop. The private driver I used in Agrigento was recommended to me here on this forum. The private driver I used in Palermo was found on tripadvisor.