Firstly, that's not where the Trans-Siberian railway goes. You'll need to disconnect and take the train from Nososibirsk down to Almaty (35 hours). From there you're out of luck, train-wise. You get a shared taxi or bus across the border from Almaty to Bishkek (it's very easy, the bus drops you off at the border, you cross, and it meets you on the other side).
From Bishkek, as you expect - you're going to need shared taxis. There is one train - from Bishkek to Lake Issyk-Kul, but it's slower than the bus (I tested it - took train one way and bus the other - bus is way faster).
Note that you'll need a permit to enter the Pamir area in Tajikistan, in addition to a visa.
The other way is to go down from St Petersburg through Volgograd, Astrakhan, across to Aktau/Beynou and through to Uzbekistan (specifically Kungrad) on Obshi - see my blog post on this last bit if you're interested. From there you'll train/shared taxi up to Tashkent, at which point you can get shared-taxis across to Dushanbe, then Khorog (1-2 days) and along to Murghab.