It's an old-fashioned (but effective) safety device to warn people who are leaning out of the train windows that there is restricted clearance. The soft bristles on the "brushes" don't hurt as much as concrete walls and metal girders.

Some of the older passenger coaches in Switzerland still have windows that can be opened very low and from your pictures it looks like there is construction work in progress which has probably caused the restricted clearance.
I posted a photo of a similar device in the quiz gallery a few years ago.
http://www.railwayforum.net/showthread.php?t=532