A defect on a piece of metal that holds sections of rail together caused a train derailment in Lytle Friday morning, Union Pacific officials said.