Yaroslavl can be reached from Moscow in 2 hours 50 minutes by the train "Moscow-Yaroslavl" (cost $ 10), which runs 3 times a day as well as a variety of passing trains.
Yaroslavl can be reached from St. Petersburg with a single night by a passing train (cost $ 20).
Yaroslavl is a major railway center so it has a direct connection with the majority of Russian cities. Suitable train can be selected on
Russian Railways website