I've lived in Saint-Petersburg (and often used railroads), so this answer is based on my experience.
I would recommend you not to sleep on a bench at a train station. There are waiting areas with chairs where you can spend time while waiting for your train. There might be more comfortable waiting areas at major train stations but you will have to pay money to stay there. I've never checked how comfortable they are and how much you need to pay.
The reasons not to sleep on a bench are:
It could be against the rules of a train station.
You could attract attention of police or train station workers because in many cases people who try to use benches at train stations for sleeping are homeless people.
But at the same time you should not get into big trouble for doing this.
One thing to remember: Make sure your belongings are safe, for example in a locker room or located next to you in a way that prevents anyone from accessing them without waking you up.
Here is the link to the web site of the Moskovskiy train station. (it is in Russian, please use an on-line translator).
This page describes aforementioned waiting rooms.
- The comfortable waiting room works 24/7.
- The price to stay at night time (22:00 - 8:00) is 220 rubles for the first hour + 110 rubles every next hour.
- Storing packages or luggage: 150 rubles for one place (not sure what does "one place" mean).
On the photos I do not see beds there, but if you will decide to use this room you can always ask them if it is OK for you to lay down and sleep. Most likely it will not be a problem, considering that you are paying money.
The location of this room is the second red rectangle on the map (with two words
Зал ожидания written on it). The left entrance on the map is the entrance from the Vosstaniya square and it can be seen on the Wikipedia page. But if you will arrive on the metro you most likely will enter the train station from the bottom entrance.
The rectangle located in the top right corner is the waiting room which you can use for free. Another free waiting room is located on the second floor of the train station. You can get there from the main hall (where the Monument of Peter the Great is located).
Per this page you will be given a place to sleep for 700 rubles (in the room with 4 beds, other options are available too). Maximum time to stay - 6 hours.
I did not include prices in dollars because exchange rates could change.
On the other note, while you are waiting for the train I would recommend you to explore the Nevskiy Prospekt (the Moskovskiy train terminal is located on the Vosstaniya square which is on the Nevskiy Prospekt) - main street of the city. It is awesome and super beautiful, especially at night. It should be safe to walk there at night, because there are many people around.