The former heads of Royal Bank of Scotland and HBOS have apologised for the "turn of events" that led to their banks being bailed out.