Brisbane Heat looked to be cruising before Sydney Thunder flipped the game on its head, triggering a major collapse and sealing a nine-run win.