When in low light the AF will be slower and hesitating. This is not unique to Xperia S. Any digital camera using AF(either phase detection or contrast detection) are like this.
This is also why on most digital cameras there is a "AF assist lamp" to help the low-light AF situations.
Try turn the video recording light on and make it the "AF assist lamp".
HTC One M8 Developer Edition
M8_UL_CA PVT SHIP UNLOCKED S-OFF
CID-BS_US001 | HBOOT-3.18.0.0000 | RADIO-1.19.21331147A1.09G | OpenDSP-v38.2.2-00542-M8974.0311 | OS-2.22.1540.3