I have an immediate family member who is in and out of charitable homes and hospitals due to mental illness and addiction issues. He has been attacked and hospitalized a few times while drunk and unable to defend himself. He has passed put drunk in public and been robbed while unconscious.
The man you saw may have a disability or a mental illness that makes him extra vulnerable. Just by being homeless, he likely doesn't have a family to go home to who could take him to the hospital or check in on him.
What the bakery employee did was assault and it is illegal. Please call the police non emergency line and ask how to report an assault you witnessed. You will speak to a police officer, and they will take down the information. Make sure you tell them it was not a fight. The man was being beaten and not fighting back.
Even if they don't have enough to charge the employee with assault, if they come around asking him about it, he will then know someone had the sense to report him, and he may avoid attacking someone else in the future to avoid the legal trouble. They can also keep that on file in case it's part of a pattern, and they need to investigate the same person for something else. An officer may also go to the homeless man, ask him if he is injured, and tell him somewhere he can go to get treated...if the police aren't douchebags where you live.