Terry Flannigan upset the odds to claim the Prizefighter lightweights title at the Liverpool Olympia.