You also have to be pretty quick at getting off and on. The train, which goes the full length of Italy, only stops for 2 or 3 minutes at each station, so in the morning you will need to be up around Pisa and ready to hop off as the train pulls into La Spezia.
I hope you can sleep better on night trains than I can.
If you are on the second train of the night it gets in at 6:30 am (IF it is on time). If you are on the first train of the night you get in to La Spezia in the middle of the night.
I haven't ridden that route but I have ridden my last night train. I far prefer to use the up to 300 kph trains which whisk me from place to place in a flash.
I don't know about safety. Occasionally one hears things which may be true or embellishments. Who knows. If you are in a closed compartment with up to 5 unknown people who knows what happens when you are asleep. I wouldn't be overly concerned.