Indian Railways (IR) plans a massive investment of Rs 16.7 lakh crore by 2031 for various infrastructure projects, according to a report by ICICI Securities.