They still have magazines on them, so they can respond to a threat in a few seconds. And no amount of discipline can completely prevent accidental discharge.
He's just standing there either for ceremonial reasons or for training (possibly both). In any case, his only task is to stand there and call the police if there's trouble.
An attack on the guard himself is likely to lead to a resolute counterattack.
Soldiers guarding typically have limited police jurisdiction of the area they guard in most countries.
This should be common knowledge.
Your point of view is not always correct, so it should definitely not be common knowledge.
Local mileage and laws may vary, but erring on the side of caution when you see a soldier means that it's prudent to act as if he can legally fire upon you -- even if that assumption is not actually true at that specific time or place.