Shanghai, Nanjing get green light for railways