Salerno to Sicily
You can take a direct train, where the train gets loaded on the ferry. Search Salerno to Siracusa or Palermo.
Or you can do the crossing of the Messina Strait separately, which is sometimes quicker and certainly offers more options. Search Salerno to Villa S. Giovanni, which is on the mainland.
Then you need to take a catamaran or ferry (frequent departures, buy a ticket on the day for a couple of Euros)
Then search trains from Messina to Siracusa or Palermo.
As @rvdborgt says, schedules for July won’t be published yet. Check dates next week or next month to get an idea.
Sicily to Matera
There’s no train to Matera. I don’t know the area, so you might want to check locally which is the most useful train station, and how to get there. Car/ bus/ taxi?
There’s a train line running from Metaponto to Potenza which passes close (ish) enough for a taxi. But you might prefer to rent a car from a decent-sized town or city.
But you’d definitely start by going back the same way, across the Strait to Vila S Giovanni.
Matera to Paris
Good connections from the south of Italy to Milan or Turin. It’s a long journey, so might be a good candidate for a night train. There are direct TGVs from Milan/ Turin to Paris, hopefully restarting in Spring. There’s a hefty reservation fee to use a railpass. Alternative routes via Switzerland or via local train to Nice - much slower though.