Water landings are a documented procedure for planes, there is a checklist (which Sully had practiced in simulators).
Assuming an AI like this was given 100% control over a commercial plane, it would have been programmed with such a checklist. It would have also been tested on this ability in a simulator (just like regular pilots). The AI would have easily worked out in an emergency that it couldn't reach the runway, or any alternative runway and not even bothered trying.
The only question is, would the AI have decided that the Hudson was a valid surface for a water landing attempt? And that really depends on the database programmed into the plane. It can't really see the river, so the database would need to have the river marked as water, at the correct elevation. It also can't really see the bridges (maybe if it had LIDAR), so the bridges would have to be included in the database too, so it could pick a good stretch to try and land it. Oh and boats too... either it would have to dynamically spot them, or get lucky.
But if the database correctly reflected reality, then it would see the opportunity, try to execute it and potentially succeed.