Code with single index surely looks neat but may not be great for runtime. String comparison is expensive task. Consider an array of strings that is filled with large size words and filled with a lot of word2.
With two index, at max we will compare each word2 twice where as in this we will compare it three times. Better to pay price of arithmetic operation compared to string equals.
Also we can break out of the loop if you ever see distance 1, we are never going to find better distance than that.
Just wanted to tell that, if you initialize the index1 and index2 with len(words) then your solution will become wrong. In the scenario, where the first word in the list of of words is neither word1 or 2.