Experts investigating the cause of a train crash in Spain that killed 40 people have found a broken joint on the rails.