Home hero Aleix Espargaro took top spot honours, while Pecco Bagnaia had to fend off a late charge from Maverick Viñales in a gripping finale