Banking giant JPMorgan has won the bid to take over all the assets of the troubled First Republic Bank after efforts to revive it failed.