I had a "diesel runaway" on my 07 Mk7 and the problem you describe made me think of this straight away. As LK said, revs were way over the 4500 rpm mark and the only way I could stop the engine was by stalling it from stationary in 5th gear. There was more smoke than I have ever seen come out of a van. No conrods hanging out of the side of the block, but upon inspection a hole was visible in the top of piston no1, no doubt caused by a faulty injector. According to the mechanic I sold the van to, surprisingly the engine suffered no damage other than the piston, though I assume he also sorted the injectors. See the following link for more info on "diesel runaway":-
https://www.team-bhp.com/forum/technical-stuff/204960-diesel-engine-runaway-what-how-stop.htmlBy memory, piston 1 is on the passenger side and I seem to recall there was a recall in relation to injector issues on this side though this was surely sorted by 2013? If you had no smoke when the engine was over revving it is unlikely to be a holed piston. A compression check would confirm this. The loud ticking developing into a loud rattle is of concern, but better than a loud knocking. If you had no smoke, first thing I would do is remove the starter motor (also on passenger side) and check for visible damage to the gearing (broken teeth etc.). If OK, install new starter motor and check if the engine turns over smoothly. You never know, it may even start. If the engine does start and the noise has gone away maybe the cause was the faulty alternator. If the noise is still there, another possible cause for the rattling you describe is failure of the dual mass flywheel (if fitted). How would this cause over revving, my guess would be damage to the crankshaft position sensor.
I should finish by saying I know nothing
