Sainsbury's has apologised after 10 people were left trapped in a broken lift at one of its stores for more than two hours.