The budget carrier’s pivot to ultralow fares brought it success but competition, rising costs and a failed merger bid hurt the business.