I think that you can book train tickets by phone, but still you need to take them out 2 or so days before you travel. Have a look at Latvian railway homepage http://www.ldz.lv/?object_id=861 (in English).
I've travelled to Russia probably 15 years ago last time, so can pass over only other people advice on borders. They still can be tough and rude to you, this is true. So, it is better that you have all your documents in order and maybe some additional papers with you as well.
-:- Message from TripAdvisor staff -:-
This topic has been closed to new posts due to inactivity. We hope you'll join the conversation by posting to an open topic or starting a new one.
To review the TripAdvisor Forums Posting Guidelines, please follow this link: http://www.tripadvisor.com/pages/forums_posting_guidelines.html
We remove posts that do not follow our posting guidelines, and we reserve the right to remove any post for any reason.