

One of the cool things about those types of technology is that you can stack them. Something like photovoltaics on top, thermoelectric under that to take advantage of the differential between the heat at the solar cell and something like the ground or the tracks themselves, and underneath all that would be the piezoelectric that you’re talking about.
Of course, everything that you add causes some energy loss between each of the systems, but if you’ve got the money for the hardware, then the sunlight is free, the heat from the solar panels is already a planned energy loss, and the noise/vibrations/movement from the trains are known and accepted losses already. Even though each energy transducer wouldn’t be used in its most efficient way, it would still be a net positive.
Hell, make everything easy to disassemble so that it’s super-repairable, even though that introduced even more inefficiencies: it’s still making use of all the free energy just sitting there and waiting for someone to use it.




Also, you usually crush and shred the materials in solar panels for recycling, so no one cares if replacing a panel means smashing it to quickly get it out between the tracks. Train tracks move far more than most people would expect, so the panels are already going to have a built-in buffer zone in which you can quickly and easily place a panel. As someone else said, something riding on the rails would likely be leveraged for installation.
Rails have a fairly consistent width when measured on a rough scale, as does the vehicle riding the rails have a fairly consistent center point. As long as the electrical leads are robust enough, and the contacts forgiving enough towards slop, the panels could be designed to just drop in. If curves are too difficult or expensive to accommodate, only install at the flats.
As with any program like this, as long as the overall energy output exceeds the cost of installation, then it’s totally a net positive, even at the lowest levels of efficiency. And if parts break, but you’re still netting positive, then little or no maintenance should be considered over the lifetime of each hardware deployment.
The key thing is ensuring that contracts with suppliers and workers are reasonable and benefit local communities. But that’s just about the biggest difficulty with any transaction these days, isn’t it?