In Mark 11:27-12:44, Jesus is in the temple, where the Pharisees, scribes and Sadducees try to trick him into error, with one question after another. The question of the Sadducees is divided into three parts: 12:19 is a quotation from Deuteronomy; 12:20-22 is the narrative of a case; and 12:23 is the trick question by which they hope to catch him. The Sadducees did not believe in resurrection of the dead, and here they think that there is an insuperable contradiction between the Deuteronomic command for a man to marry his dead brother's wife if she has no children, and the resurrection.
Jesus treats this as two questions and gives two answers. In 12:25, he says that when they rise from the dead they are like angels, neither married nor given in marriage. The answer in 12:26-27 turns the question back on the Sadducees.
The Sadducees think of Abraham, Isaac and Jacob as simply dead, which means that when God had said, "I am the God of Abraham, Isaac and Jacob," he was the God of the dead. But Jesus' notion of resurrection means that Abraham, Isaac and Jacob are not really dead, but alive, and so God is the God of the living.
There is no sense in this passage of one God of the dead and one God of the living. It is a carefully constructed philosophical discussion that there is no God of the dead, only of the living. In Mark's Gospel, Jesus has proven his point by showing that the resurrection is real, as confirmed by verse 12:28 ("perceived that he had answered them well"). So, Jesus is able to tell the Sadducees their understanding is greatly in error.