Random walks on a tree and capacity in the interval