An earthquake in New Zealand caused this deformation of the train tracks.
Dave Petley, blogging at the American Geophysical Union, isn't exactly sure what caused the strange deformations, but speculates that "The compression on the very strong railway line was accommodated when a weak point was found, leading to a comparatively rapid deformation to form the main buckle on the left. This then concentrated stress on both sides of the buckle, allowing the other (right side) bends to form."