Not sure the return on investment would be there. Solar panels would technically save some horsepower from been used to generate HEP (Head End Power) To be effective you would need a storage system (batteries), and that weight and space.
When a locomotive start to move it has more than enough power, so a battery booster system is not need. (In freight service we have slugs. The mother locomotives will provide power to the calf [traction motors and concrete weight]. So when starting the excessive power will go to slug. Then as the train pick up speed the slug will stop getting power to its traction motors, as the mother locomotive needs that power to go faster.
So the advantage that I see, would be longer trains. Less voltage need to travel thur the HEP cords, as each coach would have the ability to cover any spikes in demand, and decrease the power requirements thur from the locomotive. You can also get soft start for the HVAC system to even out any start up demand, even with out the batteries and solar panels.
In recap if you did this it more of “green wash” than actually savings.