I like to keep such config files separate - it makes it more specific and explicit. How these are kept separate and deployed is at your own discretion. I've had fairly positive results by branching my code for development, staging, and live - but I've also seen situations where a merging in from an external branch (ie three times) is a complete nightmare on bigger projects.
Alternatively, you might have config.php, config.php.live, etc - but this requires manual maintenance.
Your miles will obviously vary, my config files tend to have more than one variable differing between deployments, and as such, this extra architecture pays for itself.
If you do still want to do it with capistrano - you can use sed to change that line using a regular expression:
sed -i 's/$env=\"development\"/$env=\"production\"/' config.php
obviously, running this once the file is deployed.