Indian Railways plans to tap the sun for energy needs so that it can reduce its dependence on electricity generated by fossil fuels.