The berserk ability gives stat bonuses and makes the unit attack on it's own accord. In addition, and more importantly, it gives your unit new moves if you use it after moving. In other words, you can close with the enemy faster. The AI doesn't take this into account.
if the AI has a melee unit that can't reach it's target unit in one turn, it should use berserk after moving, not befofe.