Mahoney to seek reelection, setting up possible legal battle