Why does my apartment complex 'sway' at night when freight trains pass?

i live in a block of flats, 4th floor flats, low rise - next to a railway line..and at night i often hear freight trains passing through the night and when they go by, the apartment slightly wobbles or vibrates?

why is this?
1 answer 1