I think the Teiki is valid for a predetermined route, and every station that falls along that route, generally the most direct path between the two stations. So if your Teiki is for Ueno-Shibuya, you'd be able to travel between any two stations that falls along the route on your Teiki without paying. In other words, you've already paid for the Teiki, so you don't pay for the portion of the trip that involves those stations. For your example, this could be either way on the Yamanote, or perhaps the Ginza line, or a combination of Ginza and Hanzomon line with a norikae at Mitsukoshimae.
Does anyone know if you're able to choose the path on your Teiki, so it may include stops you frequent but may not necessarily fall on the most direct path (or maybe avoid a line that's notoriously crowded), or can you get a Teiki for something like the entire Yamanote line (which I imagine would be really expensive, if possible at all)?