How is it possible that the energy needed to stop a train is the same as the (chemical) energy in a pack of chocolate cookies? Today my friend told me something that blew my mind completely.
He said:

The energy necessary to stop a train is equal to the energy in a pack of cookies.

How is that possible? Is he right? I'm done understanding energy if he's right...
 A: I believe he is wrong, but not about the number.
From @JohnRennie answer we see the energy of the cookies is roughly equal to the train's kinetic energy, so we need such amount of energy to accelerate the train to this speed. However, 

Energy to stop train...

Energy , or work required to stop a train generally doesn't equal to the train's kinetic energy $E_k$, and can be extremely little.  Edit: as @kojiro and @Asher pointed out in the comments, according to Work-Energy Theorem, the work done on the train equals $-E_k$. But I think it doesn't invalidate the reasoning: the ground lose no energy when doing work on the train.
For example, we can push an obstacle into its way:  ( Overlooking from the sky )
                           (rock)
[  train  ][  train  ]>
                         | (rock)
                         |
                         |
              push this thing to the north

Theoretically we need zero energy if the ground is friction-less. All the train's kinetic energy becomes heat.
More practically we just brake the train. Braking a fast bicycle doesn't need so much energy from the rider's hands, right?
In conclusion, we cannot calculate the "energy" needed from the train's mass and speed.
What we can estimate is the impulse needed to stop the train. The train's momentum decreases from $mv$ to $0$, so it must be given impulse $J = mv$ in the reverse direction.
A: In the UK a packet of biscuits would typically be 200 g and contain about a thousand Calories or 4.2 MJ. By contain I mean that if the biscuits were burned in oxygen the energy released would be about 4.2 MJ.
If a train has a mass $m$ and is moving at a speed $v$ then its kinetic energy is:
$$ T = \tfrac{1}{2}mv^2 $$
Equating this with the energy in the biscuits we find:
$$ v = \sqrt{\frac{8.4 \times 10^6\ \text{J}}{m}} $$
Googling suggests the weight of a train would be 100 to 1 000 tonnes depending on the type of train. Using the lower figure we get $v \approx 9\ \mathrm{m/s}$ while the higher weight gives $v \approx 3\ \mathrm{m/s}$.
So the two energies are actually comparable (if it's a slow train :-).
But it's important to be clear what we mean when comparing the energies. What we mean is that if we put a packet of biscuits into the burner of a 100 % efficient steam train then the energy released as the biscuits were burned would accelerate the train from standstill to the velocity calculated above.
A: The energy needed to stop a train is the energy needed to open the air brake valve and let the air out of the air brake system (at least with US trains).  It's hard to guestimate the amount of energy required to do this, but I'd guess to turn even a moderately stiff lever would require significantly less than one kilogram-meter == 9.8 joules. 
The kinetic energy of the train, of course, is converted to heat by the brake shoes rubbing against the wheels.  That doesn't factor into the equation.
A: In his excellent answer John Rennie gives the numbers. If this sounds incredible, A more intuitive approach that indicates that's roughly in the correct ballpark is to take a look at strongman pulling contests.
https://www.youtube.com/watch?v=hP00VmKx_No shows you a dude pulling a 150 tonne train. He's not going particularly fast, but still, he's moving at, maybe, say 0.5 m/s? How many cookies should he eat more than if he didn't move that train?
Obviously, that's impossible to say, but it's clearly nothing in the league of 10 packs. It's probably more than a single pack. Looking at it this way gives you some intuitive feeling of how much energy there is in a pack of cookies compared to the kinetic energy of a moving train.
