There are some tricks to attempt to avoid this, like wearing shoes with a bigger front "box," or getting better socks, but really, after a while, if you run that far, there is wear and tear.
However, the toenails do grow back. It just takes a really long time, since toenails grow about a third of the speed of fingernails.
All of that being said, running that far is worth the training and blood, sweat and tears. I have been running for over twenty years now, and it is the simplest and most meditative and refreshing kind of exercise I can imagine.