Solar Panels are a whole different game altogether. IMO theft is not such a big issue.
The bigger issue is power loss due to lack of cleaning, battery life reduction due to lack of maintenance, etc.
It's not just the panels, you have batteries, converters, etc that need good maintenance to get a consistent ROI. However, the unit cost of power from diesel is definitely much higher than that from the grid and solar panels have a pretty good ROI when compared to power from the grid.
This seems like a good step in reducing costs of long distance train travel. Not to mention: a lot of experience would be gained in installing and operating solar panels, which could then be used elsewhere.
It's not impossible. Also, there is a scope of making the whole system carbon neutral.
Also, from a technical standpoint, especially for renewable energy systems, it's best to have isolated pockets of energy generation and consumption rather than a country wide grid.
Due to the intermittent nature of power available from renewable energy sources, it's best to have micro grids and micro storage systems.
In case of railway lines, the load on the network can be calculated to a very good accuracy, unlike the consumer grid. Hypothetically, this can mean that the rail grid can be isolated and be managed at a very high efficiency level.