The soldiers' morale was boosted by that song.

Literal

Soldiers [topic-は] that song [agent-に] morale [object-を] were-inspired.

士気を鼓舞する means 'to inspire morale.' In passive form (鼓舞された), the soldiers are the ones whose morale is affected. The に here marks the agent (the song) in a passive construction.