But in a twist no one had seen since The Avengers (and before that, The Dark Knight), it then turns out that the villain intentionally got himself captured! It was all a plan to get to Bond's boss, M (Judi Dench), who was on trial thanks to Silva's machinations. Silva manages to upload a virus into MI6's system, escapes his cell, disguises himself as a police officer, and meets up with his henchmen to take out M at her hearing ... but not before crashing an expertly timed train right on a pursuing Bond's dome.
"Usually I'm the one railing people."
Hold On, Now ...
Before we go any further, yes, this is universally considered to be an awesome movie. It's just that any time a movie has the villain do the, "Surprise! Every action you've taken has actually played perfectly into my hands!" bit with the hero, it never really makes sense. And this is a great example -- when you walk through it from the bad guy's point of view, you realize that either Silva is an incredibly lucky bastard, or he's literally God.
The entire point of Silva's scheme is to kill M during her hearing -- he has two guys waiting for him with a cop uniform after he breaks out of MI6 specifically so that he can sneak into the courthouse and shoot her. Presumably he allowed himself to get captured (as opposed to just going straight to the courthouse) because he wanted to upload the virus into MI6's computers to distract everyone.
It was all a cunning scheme to show off his Hannibal Lecter impression.