Sapsan trains depart from and arrive at the train stations located right in the heart of the cities, thus connecting both capitals from city-center to city-center in about 4 hours.
Interestingly, both Moskovsky and Leningradsky station buildings are "twins" and were designed by the same architect, Konstantin Thon, in the late 1840s.