I took the train from mainland Italy to Sicily (and return) last June. It was enjoyable, and I would recommend doing this trip by train at least once in a lifetime, because the scenery is lovely, especially when crossing the Straits of Messina and traveling along the coastline in Sicily and parts of Calabria. If you don't want to break your journey somewhere in southern Campania or Calabria, I recommend taking the daily early morning Trenitalia direct Intercity train which departs from Roma Termini at 7:26 and from Napoli Centrale at 9:45. There is also a second daily direct IC train leaving 4 hours later, but I prefer the earlier train. It's a long trip (11.5 hours to Palermo, half an hour less to Siracusa) and you need to pack a lunch and bring enough water or other beverages with you (there are vending machines on board for those who forget, but the quality of the snacks and hot coffee is not on par with what you can purchase fresh).
While the one-way "base" fare from Rome to Palermo is 80.50 Euros in second class, one can snag a discounted ticket with up to a 65% discount by booking the "Super Economy" fare WELL in advance (non-refundable and non-changeable). That brings the fare down to roughly 27.90 Euros (Rome/Palermo), which is a real steal! If you are concerned about the need to modify your travel date or cancel the trip, you can opt for the "TiRimborso" refund feature (must be purchased simultaneous with the ticket) which allows you to CANCEL (not modify) your reservation up to 23:59 (Italy time) on the SECOND day prior to your scheduled travel date. You will get a 90% refund of what you paid for your ticket. The "TiRimborso" option is available for the "Super Economy', "Economy" and a few other discounted tickets, at an additional cost of either 1 or 2 Euros per ticket. It is WELL WORTH it to purchase this partial refund option, especially if you book your ticket many weeks or months in advance. The "TiRimborso" option is optional, not mandatory. (You can always modify your travel date or time, more than once prior to train departure, if you purchase a "base" fare ticket (the most expensive fare). You can also cancel a "base" fare ticket, prior to train departure, and get an 80% refund of what you paid for the ticket).
These direct Intercity trains have three second class and one first class railcars to EACH of Palermo and Siracusa. The train splits in two at Messina (each with its own locomotive), half going west to Palermo, the other half going south to Taormina, Catania and Siracusa (there are other stops en-route). The electronic seat reservation system assigns you a seat in one of the railcars going to your final destination. All seats are reserved. The second class railcars each have around 74 seats, four-across. The first class railcars have only around 52 seats, three-across. Second class seats are 51 cms. wide and have 95 cms. of legroom. First class seats are 63 cms. wide and have 103 cms. of legroom (as described on the Trenitalia website). The seat bottoms pivot out to afford a small recline. A portion of one of the second class railcars has a lounge area with vending machines and tables. There are electrical outlets at each seat, handy to charge electrical devices (sometimes the outlets are broken or defective), plus reading lights and folding tables. Luggage can be placed overhead, or wedged in-between the seat rows, or put in the oversized luggage racks at one end of each railcar on in special racks inside the car itself. The train is air conditioned and heated, but the air conditioning is turned off during the crossing of the Straits of Messina (when it can get very stuffy during the summer).
The train (minus the locomotive) crosses the Straits of Messina on a train ferry. Passengers are free to leave their railcar (remember its location!) and climb the stairs to the open-air promenade deck, where one can enjoy the crossing, which is quite scenic on a clear day. Take lots of photos! The center of the promenade deck is enclosed (quite handy on a windy or rainy day), with many seats, plus restrooms and a coffee/snack bar.
Remember too that Trenitalia has night trains (ICN) from Palermo and Siracusa to Milan and Rome (and cities in-between), with simple couchettes (bunks) and slightly costlier sleeping accommodations including a limited number of more expensive Excelsior cabins with a private restroom and shower. All night trains have toilets/washbasins at one end of each railcar. A complimentary very simple continental breakfast is included in the fare (coffee, juice and a sweet or salty packaged snack).
The Trenitalia website has a very detailed description of the accommodation features of both the daylight IC trains and the night IC trains.