A mentally ill woman who tried to drown two children in a river was not responsible for the incident due to her mental state, a judge has found.