There is a reason cycling shoes have a very stiff sole. This keeps the foot from flexing, which over time can lead to fatigue and cramps. If this is the cause riding with your toes on the pedals as opposed to the balls of your feet tends to make the problem worse. The hydration and fit issues raised earlier are also valid and could be a compounding factor or the main cause.