There are two components of losing weight, diet and exercise.
Losing weight requires you to be in a calorie deficit; diet and exercise will help you achieve this. If you go on a 2-hour run, you will probably burn more calories than completing a 20-minute HIIT session, however, if you are short on time, then a HIIT session will provide you with the best results.
A combination of HIIT and a good diet will be very effective at helping you lose weight rather than exercise or diet in isolation.