Heidenheim scored twice in added time to come from behind and missing out on promotion to beat Regensburg and win the Bundesliga 2 title in dramatic fashion.