At least 39 people were killed and about 152 others were injured after two high-speed trains collided after one derailed in southern Spain on Sunday, according to officials.