A programme of major infrastructure works took place over the weekend as a main railway line in West Yorkshire closed throughout Saturday and Sunday.