The OP has hit the nail on the head with this chicken and egg question. The likely answer is that we won't know for awhile and which may very well depend on the patient (some patients may have genetic predispositions and have pre-diabetes before they become obese- is it the hyperinsulinemia with the impaired glucose tolerance that leads to the obesity in some patients because of the increased lipogenesis. Alternatively, if the patient is already obese, it sets up a vicious cycle).
I hate to break the deeply held belief that obesity is always a matter of calories in v. calories out but the reality is that it is not always that simple. True, this equation may be applicable in the majority of cases but there are other factors including BMR (as well as % brown adipose) that we are just starting to appreciate and trying to measure more accurately. For example, consider why many obese patients baseline temperature is several degrees under average (i.e., 96 F) and how that relates to the hypothalamus and the body's metabolic set point.
Moreover, science has made great strides in learning the different hormonal interactions between adipose tissue and the rest of the body. Even ten years ago, much of the medical profession thought fat cells did very little besides store excess calories. Now, we know that they have tremendous impact on many of our body's organ systems- one reason why diabetic patients who have undergone weight loss surgery can sometimes get off their insulin within 2 weeks of the surgery. Although the patients can lose 20+pounds in the first two week period, this window is not long enough for them to lose a substantial enough amount of weight for the weight loss to be the primary reason they can discontinue their meds. Consider the diabetic patient who was 450 pounds before surgery-- 20 pounds is not even 5 percent of their body weight. We simply do not know all the complexities involved in this process. For all you gunners out there, this could be your ticket to a nobel prize.