The ECU on these cars don't forget so easily, so I doubt if its an idle relearn issue. When ECU gets reset, it puts out higher rpms not lower, as a safety measure, till it gets its learned position.
A battery that dies once, especially flooded lead-acid type, and if its old too, then the battery is damaged. Best case scenario: battery is discharged and the voltage is too low at low rpm such as when in D or R and not moving - that causes engine to run rough.
Solution: get battery charged (through your UPS or from a battery shop - you can ask battery guys to replace water too once its fully charged), or replace it. Don't try to charge it from dead with vehicle's alternator output.