The past decades have seen a diversification of the sugarcane industry with the emergence of new technology to produce bioenergy from by-product and waste process streams. Given Brazil's ambitious goal of reducing greenhouse gas emissions by over 40\% below 2005 levels by 2030, it is of paramount importance to develop reliable decision-making systems in order to stimulate investment in these low-carbon technologies. This paper seeks to develop a more accurate optimization model to inform risk-conscious investment decisions for bioenergy generation capacity in sugarcane mills. The main objective is for the model to enable a better understanding of how Brazilian government policies, such as the electricity price in the regulated market, may impact these investments, by taking into account the uncertainty in sugar, ethanol and spot electricity markets and the interdependency between production and investment decisions in terms of saleable product mix. The proposed methodology combines portfolio optimization theory with superstructure process modeling and it relies on simple surrogates derived from a detailed sugarcane plant simulator to retain computational tractability and enable scenario analysis. The case study of an existing sugarcane plant is used to demonstrate the methodology and illustrate how the model can assist decision-makers. In all of the scenarios assessed, the model recommends investment in extra bioelectricity capacity via the anaerobic digestion of vinasse but advises against investment in second-generation ethanol production via the hydrolysis of surplus bagasse. Furthermore, the decision to upgrade the cogeneration system with a condensation turbine is highly sensitive to the electricity price practiced in the regulated market, capacity constraints on the sugar-ethanol mix, and the accepted level of risk. Another key insight drawn from the case study is that recent market conditions have favored a production focused on the sugar business, making it challenging for policy-makers to create attractive scenarios for biofuels. Long-term electricity contracting appears to be the main hedging strategy for de-risking other products and investments in the sugarcane business, provided it is priced adequately.