The soldiers headed toward the border while staying on guard.

Literal

Soldiers [topic-は] be-vigilant [while-ながら] border [direction-へ] headed.

へ向かった ('headed toward') is a simpler phrasing than the longer に向かって進んだ — the へ alone marks direction without an extra 進む. ~ながら links the simultaneous actions of being vigilant and advancing.