To travel from Kazakhstan to China by train, you have once per week a direct overnight train from Almaty (Kazakhstan) to Ürümqi (or Urumqi / China). The journey time is about 36 hours. Buy your train ticket via the given booking link (write the city name like "Urumqi").
If you want to travel from Kazakhstan to Russia, buy your train ticket locally at a train station in Kazakhstan or via one of the given booking links. There are direct overnight trains available between both countries.
If you want to travel from Kazakhstan to Uzbekistan by train, buy your train ticket locally at a train station in Kazakhstan. Direct train connections available between both countries.