I'm personally not a fan of Marseille, and the station area is not the safest. Trains aren't accessible overnight. I'd recommend a ho(s)tel, even if just for those few hours.
Totally agree with Schelte : get a hostel/hotel room.
And if you can leave Nice earlier definitely do it. That way you can have a longer night sleep... :)
There are reservation-free TER at 16:25, 17:59, 19:25 and 21:30 for example.
Out of service trains are not left open and accessible for people to stay in at night as they would just be magnets for homeless people and criminality. They also get removed to the depots to be serviced, cleaned and repaired at night in many locations.
I would also advise against trying to stay or sleep in any station overnight, I am not that familiar with Marseille but as there are no departures between 22.00 and 05.00 it is probable that staff will clear it out and close the station once the last arrivals have come in.
If possible change your plans to give yourself a decent night sleep in a bed in a hotel or hostel.