To build a tunnel, simply let the road or railroad end oneach hillside, as shown in the first picture. Then click one of the roads ends with the tunnel building tool. Right after the click, you should have build a tunnel as shwon on the right image.