Plane from Riga to Moscos flies 1,5 hour. If you buy ticket beforehand, it can be cheaper than train ticket. And there is no problems to get to the centr of Riga. Bus from the airport goes around 30 minutes. Riga RIX Airport is the closest point to Russia, from whence flies Ryanair and other global low cost airlines.
Train Latvijas Ekspresis goes from Moscow or Saint Petersburg just one night: in the evening you sit in the train, and in the morning you are already in place. Runs every day. Train is rather comfortable transport, and even famous russian pop stars, as Alla Pugacheva, often use train to get to Riga.
Most budget trip's option is a bus. It is cheaper than train, and by time is going about the same. The main disadvantage is a necessity to spend 10-14 hours in sitting position. From advantages - bigger amount of stops in different Latvia's cities. Also buses got more destinations in comparison with a train. You can go to different cities in Europe by bus.