Hi carter, running form is a debate that could cover quite a few threads with various theories around the "perfect" form.
In this context, the OP could run comfortably for the first 15km with a forefoot strike. As they tire, the legs and upper body start to weaken and this alters the foot strike. Its not mentioned but its also likely that their cadence and pace drop for the same level of exertion, so it becomes harder to run at the same pace.
So in this case the best running form for the OP appears to be a forefoot strike, but your best running form may involve a heel- or midfoot- strike. The aim is to find a form that stays comfortable for the length of the race and allows you to run efficiently. In reality, even the top runners form will deteriorate over the duration of a marathon - although the OP seems to be an extreme example.
I've read the "Chi running" book that has some interesting views on running posture etc, and the other one that gets mentioned quite often is the POSE method. If you google these, you should get some further reading.