The train approached the town.

Literal

Train [topic-は] town [to-に] drew-near.

近づく ('to approach, get close') takes に to mark what you're approaching — the target is marked as a goal, not a direct object. A productive pattern in Japanese: verbs of approach, attachment, and meeting typically use に rather than を for their target.