Olympic runners-up Brazil beat Serbia 3-2 (22-25, 25-23, 25-22, 23-25, 15-12) in a thrilling final match of the FIVB World League.