I recently took the overnight train (Tolstoi no. 32) from Moscow to Helsinki which stopped in St. Petersburg. The train left Lenningradskiy station around 11 at night and arrived in St. Petersburg at around 6 a.m. the next morning.
It was a lovely ride with comfortable beds and pillows, a video screen in the compartment and coffee and tea service on demand.
I'd do it again in a heartbeat.