A 2-mile treadmill walk provides a short workout that can burn a few calories. The emphasis being on "a few." While a 2-mile walk is better than nothing, you shouldn't expect to lose weight with this workout alone.
Tiny Weight Loss
To lose a pound of fat you need to create a deficit of 3,500 calories. A 120-pound person will burn about 170 calories in a 2-mile treadmill walk. That's equal to about 0.05 pounds -- or less than 1 ounce of weight loss. Heavier people burn calories at a faster rate. A 220-pound person will burn about 270 calories walking for 2 miles. That works out to about 0.08 pounds, or just over 1 ounce.
Walking 2 miles per day hypothetically would yield weight loss of about half a pound per week. But this assumes that the person is not consuming calories in excess of daily needs. If you increase your intake you will reduce your weight loss. For safe weight loss create a daily deficit of 500 to 1,000 calories a day, which should yield weight loss of 1 to 2 pounds per week.
Upping the Intensity
To increase your metabolism and continue burning calories after your workout, you need to perform high-intensity exercises or strength tranining. Walking on the treadmill is a low-intensity exercise so you won't benefit from this afterburn effect. But if you are morbidly obese, this may be all you are capable of and can be a good way to start an exercise program.