Two people died Sunday when a cargo train derailed in the central Peruvian province of Huarochiri, near Lima, local media reported.