The answer is definitively contained in the sentence immediately prior to the quote:
By now we could see snow-capped mountains gathering on the horizon. We entered a valley where the river was wide and mostly clogged with ice, brilliant white and glinting in the sunshine. The trail hugged its bank, twisting with the meanders as we gradually gained height and the valley sides closed in.
It in the quotation in the question is the river, and bank refers to the bank of the river, along which the trail ran.
While a river bank could easily be a shallow and wide slope (with the trail following the highest contour), it's more likely to be steep, falling to the river itself, with the trail above and not far away from the water.