Grindelwald was arrested at the end of Fantastic Beasts and Where to Find Them, so how did Dumbledore defeat him to get the Elder Wand?
Evidently he got out of prison
Grindelwald himself fully expects that MACUSA won't be able to hold him forever:
Grindelwald: (with contempt) Do you think you can hold me?
Fantastic Beasts and Where to Find Them: The Original Screenplay
Fantastic Beasts takes place in 1926, per the screenplay and the montage of newspapers in the opening scene; however, the first book establishes that Dumbledore and Grindelwald had their famous duel in 1945:
Dumbledore is particularly famous for his defeat of the dark wizard Grindelwald in 1945
Harry Potter and the Philosopher's Stone Chapter 6: "The Journey From Platform Nine and Three-Quarters"
So he's got 19 whole years to figure out how to get out. A lot can happen in nineteen years.
The exact circumstances of his escape haven't been discussed, but will likely be a plot point in a later film in this five-film series. Johnny Depp, who played the unmasked Grindelwald at the end of Fantastic Beasts, has already been signed on for the sequel.
He escapes in the second movie
The latest from the studio is that, in the new film, Grindelwald will ‘make a dramatic escape’ from MACUSA custody, forcing Albus Dumbledore to join the wizarding world’s efforts to stop him.
The villainous Grindelwald has been busy ‘gathering more followers to his cause – elevating wizards above all non-magical beings’. Dumbledore will look to his former student Newt for help.
He escapes soon after - and doesn’t fight Dumbledore until 1945.
The first LEGO set for the new movie is called “Grindelwald’s Escape”, and combined with the new trailer, gives a bit of a hint as to how he might escape.
The set comes with Gellert Grindelwald, a Thestral-pulled carriage, and the MACUSA president Seraphina Picquery. The trailer for the movie shows Grindelwald sitting in this carriage, with two unseen Aurors pointing their wands at him. Since the set with this carriage is called “Grindelwald’s Escape”, it seems likely that Grindelwald will escape while being transported in the carriage.
In one of the updates that came when the title of the next movie was revealed, it’s made explicitly clear that Grindelwald escapes shortly after being captured by MACUSA and continues with his plot to bring wizards out of hiding from the non-magical world.
It’s called Fantastic Beasts: The Crimes of Grindelwald
Straight away the title says that Grindelwald (Johnny Depp) will be a big focus in the second film, after having been unmasked in Fantastic Beasts and Where to Find Them. Clearly his capture by MACUSA won’t last for very long, and Grindelwald is still intent on exposing the wizarding community to the non-magical world.
So, what will he do next? As the title suggests, not nice things. Grindelwald escapes custody and sets about gathering followers to his cause. What many of his new devotees don’t suspect is that his true intention is to raise pure-blood wizards up to rule over all non-magical beings.
We know from the Harry Potter books that Grindelwald’s ascent represented a dark time for the wizarding world – much like the rise of Lord Voldemort. So, things are about to get serious.
Everything we know about Fantastic Beasts: The Crimes of Grindelwald so far - Pottermore
The same article also explains that this next movie will take place in 1927, shortly after the first one. That leaves quite a bit of time before his final defeat by Dumbledore in 1945. At least so far, it seems like the Fantastic Beasts franchise will keep to and expand on the Grindelwald/Dumbledore story already in the books, as Grindelwald is also shown with the Elder Wand. With that many years to go before the duel, it’s possible that he might actually be temporarily captured and escape yet again before his final defeat by Dumbledore.
A separate promotional feature on Pottermore released on the same day as the title of the movie, on Grindelwald’s life, actually refers to the fact that getting arrested didn’t stop him from continuing his plan. So, it doesn’t mean he’ll be stopped from dueling with Dumbledore either.
With the help of Magizoologist Newt Scamander, Grindelwald was caught by MACUSA. Still intent on overthrowing the Statute of Secrecy, rules that encouraged wizards to hide from the non-magical community, Grindelwald didn’t let being arrested stop his twisted quest.
Grindelwald: the story so far - Pottermore