The goal is laudable. But the timeline seems a little unambitious.
When I wrote about a modular, battery-electric train, I noted that much of the UK's train fleet still relies heavily on diesel. Electrifying all of its train lines, especially regional branch lines, would be a monumental task.
I will say that the timeline seems a little leisurely, with Rail Minister Jo Johnson identifying 2040 as the end date. But as with many such goals, I do believe that the direction of travel is at least as important as the specifics of the timeline—not because the rate of change is irrelevant, but because the goal itself will build momentum of its own as companies invest in the technologies of the future.
Now, it's important to also note that "diesel only" does not mean that all diesel will be history by that point. Johnson suggested that complete electrification was unlikely to be the most effective route, suggesting instead that bi-mode trains (electrified track plus self-powering diesel) would provide an initial bridge to hydrogen and/or battery electric trains.
This all seems like an important step in the right direction. That said, in a world where Norway is aiming for all-electric short haul flights by the same date, I can't help but wish that Britain would set its sights a little bit higher.