Cramp and what can cause it in ironman and triathlon athletes

Advancing age and a long history of running are both associated with the onset of leg cramping in older runners.
Other risk factors are high body weight (not necessarily being overweight), Family history of cramping, worn shoes, poor or nonexistent stretching habits, and awkward running technique.
Another theory is using protein for energy once carbohydrate stores are low, there could be more than just one reason to cause leg cramps.
The most current one is simply that fatigue interferes with the neurological mechanisms controlling muscle contraction. In your case, this makes sense because the exercising body tends to fatigue more easily as it gets older.

The other theory is that cramps result from semi dehydration before running and electrolyte imbalances and dehydration during.
Electrolytes are minerals that carry electric charges to the muscles to help them contract or relax so any insufficient amounts in the diet can lead to muscle weakness and cramps as well as other problems. Potassium, calcium, magnesium, and salt are the electrolytes of major concern.

Some sports nutritionists now tend to debunk the dehydration/electrolyte theory. They say that dehydration should not be a precipitating factor. Most athletes know how to stay well hydrated. Also, electrolyte replacement should not be a concern. The preferred hydration fluids among runners are sports drinks that contain electrolytes.
In addition electrolytes are so widely distributed in the foods we eat that intake far exceeds need even that required for marathoner.
Potassium is needed and can be obtained from avocado, bananas, beef, cantaloupe, honeydew melon fish, fruits, milk and vegetables. Salt is common in most foods so doubtful that most people consume not enough.
Preventative measures include checking shoes for excessive wear, your running technique, stretching before and after a run and making sure you are warm before stretching.

Cramping can be helped sometimes even by just holding the muscle in a stretched position for the count of 20-30 or until you fell the muscle relaxes. Stop the session if you get severe cramp