Lego has made its highest ever sales as the toy giant said it was outpacing a declining market, and working hard to “stay relevant” amid new brand tie-ups with Nike and Formula 1.