The German railways site is a good starting point for train timetables all around Europe (not fares though, except if travelling in or through Germany).
For Ljubljana -> Kjev it doesn't give very good suggestions though, simply because there probably IS no very good connection, and it's a very long journey. The "least complicate" (ie least train changes) connection that I found is through Budapest: There's a night train from Ljubljana to Budapest (leaving 2:00am, takes 9 hours), then after 7 hours wait in Budapest there's a train at 18:15 that goes directly to Kiev.. and takes 24 hours (!) to get there. This connection doesn't show up in the search system though (you have to search for the individual legs to find them), because the total trip takes 42 hours and the system finds a faster connection with the same starting train (34 hours, but with 4 changes) - the system is always looking for the fastest connection which is not always ideal. The fastest connection it lists would be 31 hours but with 6 changes...!
It also shows a direct train from Prague to Kiev, but that alone takes 35 hours and you have to get to Prague first (min 11 hours). With an extra change you can cut down Prage-Kiev to ~27 hours.., but still the Budapest option is faster overall. Actually I just read on the Russian railway site (here) that there's a through connection Moscow-Kiev-Budapest-Ljubljana-Venice once a week.. not sure which day it runs the other way though, probably not very useful, but at least it confirms that Budapest might be the good point to connect 
Also be aware of the countries you travel through... Ljubljana-Budapest-Kiev goes through Croatia and Hungary, Ljubljana-Prague-Kiev through Austria, Czech Republic and (probably) Poland. Just in case to check Visa requirements (they are all EU members apart from Croatia).
Kiev-St Petersburg looks slightly easier, there's a direct train listed which takes 24 hours. St. Petersburg to Moscow should be fairly easy with a couple connections each day.
For fares it becomes even more complicated... I doubt the long international connections will be terribly cheap, but probably still cheaper than a flight. The Hungarian railways site lists some fares for trains from/to Hungary (search through timetable), but they are listed as "reduced international fare" and "return ticket already from ...", so I don't know how relevant the listed fares are / how and where you would get them. Within Russia I have no idea.. only thing I just found is a page on the Russian railways (here) that lists some international fares.. I would expect the connections within Russia and Ukraine to be significantly cheaper than most of these connections.
Also be aware that all this might change soon, most European train companies change their timetables (and fares) around mid December.
Good luck, hope it all works out!