The route should be scenic along the Ligurian coast at least in theory (I unfortunately had to sit in a bus) when you're not in a tunnel. It's just the logistics of train travel that can be a PITA.
If you are willing to overnight in Ventimigilia (there's what appears to be a nice agriturismo up the hill from the station among other accommodation choice), there is an IC train (IC505) that leaves around 0630 and arrives into Rome 8 hrs later with limited stops with a rather-affordable FC fare.
Alternatively, there is an EC train (Thello) that leaves at 0900 and gives you an hour in Genova/Genoa before connecting onto an express to Rome that get you in at 1630.