The road journey from Tianshui to Lanzhou takes about 4 hours. About two-thrids of the route is on a new divided highway, but the last third is undivided (although still fairly new). This section is more hair-raising than many Chinese roads, and this is saying something. We saw on one trip, three serious accidents. The train is infinitely preferable, if you can get tickets.
Tianshui is 4 hours from Lanzhou, and is physically nearer the city of Baoji in Shaanxi and as easily reached from Xi'an as Lanzhou.
Most trains between Xi'an and Lanzhou stop at Tianshui, but note that getting tickets can be tricky. Even with the assistance of the Director of the Tianshui NDRC and the Director of the Tianshui Tourism Bureau, we were unable to get any tickets for any train to Lanzhou on a seemingly quiet mid-week day.