Nakagami beats Luthi after epic battle for second