Wouldn't that shake a bunch and shatter the glass and also just why?
Solar panels don't have to necessarily contain glass, the solar cells can be coated with anything as long as it's transparent, there are in fact flexible solar panels.
Like why would you ever do that?
My guess is infrastructure, the railway company already owns the land, so there's no upfront land investment.
And maybe they can maybe reuse use of the electric railway infrastructure to wire the panels?