Around 4,000 repairs and upgrades will be done over the next year after almost 40,000 defects were identified in the Sydney rail network.