A Philippine mayor who built a reputation for fighting crime apologised on Tuesday for a rape comment that caused a political storm and could dent his chances of winning the presidency in an election three weeks away.