Half-time substitute Ianis Hagi unlocked a stubborn Livingston defence as Rangers progressed to the Premier Sports Cup semi-finals following a 2-0 Ibrox victory.