Another player's station in a city doesn't really block your line,
There are only two situations when the location of other stations matters:
1) If you are placing a station in a city, there has to be a path from that space to one of your stations in the mountain that doesn't pass through another player's station. This rule also applies when scoring the station at the end of a round.
2) When prospecting, your route must begin from one of your stations and end in another (cannot both be the same station, since your route can't ever cross through the same tile twice). Your route may also never pass through another player's station.
When placing a station "in the mountain" (i.e. not in a city), all that matters is that you place it on a tunnel tile that you just placed. In other words, placing a station in the mountain requires two consecutive actions: placing the tile and placing the station on it. Whether there is a route connecting to that station from another station of yours or another player's is irrelevant.
So to answer your question as I understand it: NO, your route when prospecting cannot pass through a city space in which another player's station is located, or that is empty! However, your route CAN pass through a city space if one of YOUR stations is in that space.