Britain's Alistair Brownlee produced a dominant display of running to take the Olympic triathlon gold medal, with brother Jonny claiming bronze.