An implied metaphor is a type of metaphor that compares two unlike things without explicitly stating one of them. In your examples, the best choice is:
The ants are small soldiers marching.
This implies a comparison between ants and soldiers without directly saying that ants are soldiers. The other options either use similes (which include "like") or explicit metaphors.