If Elsa and Anna died, due to them having no known living relatives, Hans would have the throne due to popular acclaim, something that did happen occasionally in medieval politics. It's important to remember that he's a spare, not the heir, to the Southern Isles. I imagine that the kingdom of the Southern Isles would like to see their dynasty on the throne of Arendelle, so they would support his claim by force if necessary - force that Arendelle wouldn't be in a position to resist. In addition, the Duke of Weselton no doubt would support Hans' ties to the throne in order to win favour with him, as he clearly has no favour with the current court of the kingdom.
A search party was sent to find Anna, and considering the situation they found with Elsa's castle there and no Anna to be found, Elsa would clearly be suspect of the murder (accidental or otherwise) of her sister. Anna and Hans were very visibly lovey-dovey, ultimately drawing suspicion away from Hans, while Anna and Elsa didn't exactly get along. Then, Anna goes up to find Elsa, and she isn't found when a search party goes up to Elsa's castle. That points to Anna being not quite in the realm of the living any longer, and Elsa having something to do with it.
As for the marriage, I imagine it was just a ploy to give himself more of a claim to the throne of Arendelle, as he would be the closest, upon the deaths of the sisters, to the throne.
The loyal guards I imagine were left to die in Elsa's castle or in the mountains, and the rest of the populace were either men who had come along with Hans and the Duke of Weselton or just part of the populace, afraid of their apparently insane, angry and dangerous queen. Locking her away, in the end, was keeping her under control, regardless of Hans' intentions in the end. I'm pretty most people in Arendelle would want her locked up, simply because from what they've seen, merely being around her is almost a death sentence because she can't control her powers.