Outside of proper hydration, a key fact to note is that exercise-associated cramping is multifactorial and can occur without any dehydration or electrolyte imbalance. While dehydration and electrolyte imbalances are an important contributor to cramping for many, in most cases, cramping is related to muscular and nervous system fatigue. Thus, proper training, heat acclimatization, nutrition, and rest coming into a long event in the heat are also critical factors to consider. Regardless of your hydration and nutrition strategy, anytime the body is pushed past what it's accustomed to, fatigue ensues, often in the form of cramps.
It is very possible that you were having an issue with your hydration. It is possible that you were not getting enough sodium, which makes it likely that you didn’t have the same thirst drive and didn’t drink enough. That said, remember that cramping is multi-factorial. Anything that is going to cause you to fatigue earlier may also lead to cramping. This can range the gamut from training, hydration, electrolyte balance, thermal regulation, weather, fuel, and even the novelty of the terrain or pacing strategy. Break down the runs and explore whether there were other changes to your routine or other possible bottlenecks. I’m willing to bet it was hydration (especially if it happens more in the heat), but remember that there are a lot of additional variables that could have contributed to the perfect and unfortunate storm of cramping.