Marquez takes Thai honours after last lap battle