A soldier is an Orsimer highwayman found in The Elder Scrolls V: Skyrim. He is a Random Encounter, and demands payment when the player crosses him. He is usually followed by an Imperial mage and soldier. If his request is not accepted, they will try to kill the Dragonborn. Even if you are an Imperial, or even a legate, they will still demand payment. If the player is part of the Imperial Legion a dialogue option will become available stating that the Dragonborn knows they're not Imperial Soldiers, which results in them attacking. If you are a Stormcloak, you can declare your rejection of Imperial authority, which will cause them to attack.
It is obvious that they aren't actually Imperial soldiers and are just highwaymen in disguise. Naked corpses can be found near them, which also points out that the highwaymen killed the Imperial soldiers.