Helsinki to St. Petersburg Allegro Train - Customs and Border Officials are on Board
All the official formalities (checking of passports, customs, etc...) are done on the train, while it is rolling along, by officials from Russia and Finland. You don't have to get off. You don't even have to get up from your seat!
Between St. Petersburg and Vborg, Russian boarder guards and customs officers check passports. In Finland border guards check passports between Vainikkala and Kouvola.. All very efficient and easy.