My logic on that particular question was that someone would probably get a new trolley to replace it (trolleys are insured, right?), no matter what I thought, so I let the trolley go.
However I did not take into account the CO2 emissions and possible industrial accidents at the trolly factory or trolly materials mines.
https://www.theguardian.com/environment/2009/aug/17/car-scra...
Taking into account future discounting, it's probably almost never a good idea.
I would argue that it shouldn't factor into the equation. The polluting trolley will be replaced sooner or later, anyway. You're just moving the date forward.
The catch is that the argument could be made every year, with a new, more efficient trolley replacing the previous. In which case the construction costs obviously need to be considered, and it wouldn't be worth to spend 100 CO2 to save 10.