Why sugar solution/sugarcane juice becomes sour when kept for certain time?
This is not a complete answer but it should give you a head start.

I suspect two things: Fermentation and Caramelization.
In any fermentation process, sugar will turn into acid. It is observed from this answer from cooking.SE that at a temperature of 35-45 °C, fermentation occurs. If any sugar laden food is kept at this temperature, bacterial or yeast colony would flourish giving you the fermentation effects and making your food acrid. Fermentation process is a two-step process. First, glucose is turned to ethanol by Saccharomyces cerevisae, also known as Brewer's yeast. This ethanol is then converted to acetic acid by Acetobacter aceti, giving you the sour effect. This two-step process is called aerobic fermentation.

Caramelization generally occurs at higher temperatures, at 150-170 °C where sugars are broken down to simpler products and turning sugar into a brown-black mixture of products. This reaction is also called Maillard reaction. At this temperature, the reaction happens almost instantly but at lower temperature (35-45 °C), this reaction will takes hours, days or even months to finish it but it will speed up if there is moisture where it will take a few hours. Note that caramelization process is very complex as there are various steps. The finished product is a brown-black goo which is actually a mixture of several products. But if put it in a simplified way, sucrose breaks into glucose and fructose which further breaks into acetic acid, maltol, furan and many other products. This acetic acid contributes to the sour taste. So, in a hot-humid day, sugar can turn sour.