1. Keep dam: -$2M to -$10M
2. Dam removal with 5 MW capacity replaced/absorbed by natural gas plants (no solar/wind/BESS): -$28.3M to -$249.8M, depending on whether you use the EPA's $190/tCO2 cost of damage or $1000/tCO2 DAC remediation.
3. Dam removal with 5 MW solar/wind/BESS replacement: -$3.5 to -$25M
In other words, removing the dam without equivalent solar/wind/BESS immediately in place is a net negative for society (and even then, keeping the dam might be neutral or still better).
You did not calculate the impact on the salmon population since dams were added to the Kennebec since 1837. Both the impact on the salmon themselves as well as all of the other animals and people who relied on that salmon fishery.
It's certainly a lot larger than the benefits of the dams in my calculation.
It's not that the cost never matters but I think if the cost is really just $25MM for a transformatively beneficial environmental impact that has equivalent no alternative, in exchange for scaling back a fungible resource, is a no-brainer.
Ok, I found a study estimating a net willingness to pay per citizen for this type of ecological restoration at ~$72.31/per person/year. If we assume 100,000 people derive this level of benefit over a 30-year time horizon (same as I used for the previous numbers) that yields $21,693,000 which brings the removal WITH immediate solar/wind/BESS replacement scenario on par or marginally better than keeping the dam as is.
But even then, I believe that is being overly generous to the dam removal because electricity demand has been rising steeply recently and is projected to continue doing so. Until we are meeting 100% of current and future demand with new renewable energy, every existing carbon-neutral source that gets removed is creating a gap in future demand that will be partially filled by new fossil fuel generation and therefore incurring many of the same associated negative societal costs.