In the case of を with 行く (and other verbs of motion), it's just that the を marks where you are doing the going (or walking/running/driving/whatever with other verbs of motion). This is different, of course, from the destination you are going to which you would mark with に in many sentences.
e.g.,
公園を歩きました。 I walked in the park.
公園に歩きました。I walked to the park.
You are correct that this a conditional と, and you could also say 駅があります or 駅に着きます or the like. The way it is written, I guess you could think of it that there's an unspoken part of the conditional clause, like '行先は駅です', if that helps you understand how it works.