Not sure I understand...I don't know how their algorithm is written, but the simplest thing would seem to be to calculate the total number of movement points required to get to the destination over any of the possible paths to get there, and choosing the most efficient one. It doesn't seem that rivers require more movement points than forests, so I don't see why it would be calculated differently. Unless a turn ends once you step on a river, regardless of how many movement points you have left...in which case the AI probably sees them as "uncrossable."
Of course this also means that AI armies are probably taking some very inefficient routes on river-heavy maps.