INDIANAPOLIS — Representative Joe Donnelly, a three-term Democrat, claimed victory on Tuesday night in the race for an open Senate seat, beating Richard E. Mourdock, the Republican nominee who had been on the defensive since he said in a debate last month that if a woman was raped and became pregnant, that was “something that God intended to happen.”