Getting from Varanasi to Mughal Sarai or vice versa is quite easy. The total travel time is between 1 and 2 hours depending on traffic.
If coming from Varanasi, you want to go to Varanasi Junction – this is an area encompassing both the bus station and train station. The only way here from the Ganges river area is via rickshaw and should cost 100-150 rupees. I like to flag down a rickshaw already driving without anybody and show him a 100 rupee bill to confirm my price. The parked cars might charge you more and showing the cash up front usually avoids haggling over price.
Once at Varanasi Junction inform your driver that you want a shared jeep to Mughal Sarai. These pick up along the main road, and you could possibly find them yourself, but the rickshaw driver knows best. People just shout destinations from jeeps so you may need to ask around to find the right one.
The jeep ride is about an hour and cost 60 rupees. Almost everyone gets out just before the train station, but tell the driver you want the train and he will drive the extra 200 meters.
For Varanasi, the process is exactly the same. Catch a jeep outside the station to Varanasi Junction then flag down a rickshaw to wherever you want to go.