From Einstein's "easy" explanation https://www.bartleby.com/173/9.html
(Yes, I have reviewed 8 other answers to similar questions. Please bear with me.)
M is on the platform, T (aka M') is on the train with open carriages. Just as T passes M, lightening strikes two points A and B equidistant behind and ahead of both M and T.
For Thunder (not in Einstein's explanation), M will clearly hear both bangs together, and knowing the speed of sound through air and distances to A and B can calculate when the lightening struck. It will also take a little time for the sound to reach T in the middle of the train, during which T will move ahead of M. T will thus hear the front B strike first as he will now be closer to B than A, and the speed of sound is relative to the air. Clear.
For Light let us assume M will also see both flashes at the same time. Let that be the definition of the flashes being Simultaneous. But what about T?
Unlike sound, the speed of light is relative to the frame of reference of the observer. T is equidistant from A and B when the flash occurred, so T should also see both flashes together. Like for thunder, T has moved a little to the right of M before seeing the flashes, but M's relative position is not relevant to T's observation of the flashes.
But Einstein says, without explanation, that T sees B before A?
Question: Would T actually see B before A? If so, why?
There has also been some commentary about what M might think that T observed if M did not understand Relativity. If T had mirrors and M was observing flashes in the mirrors. But that is not what Einstein said. So let us stick to just what M and T actually observe.