Energy transition patterns point towards a gas-fueled society in coming decades, whereby natural gas plays an initial leading role. Naturally, biogas will become the primary energy source once gas reserves are depleted, which motivates investigating approaches to efficiently supply biogas-fueled facilities. Sugarcane biorefineries have the potential to become leading biogas producers, based on recent successful experiences on the anaerobic digestion (AD) of primary sugarcane byproducts, such as molasses. This study assessed the techno-economics of operating AD-based sugarcane biorefineries producing electricity or biomethane as alternatives to conventional ethanol production. Scenarios including the processing of molasses or combining juice and molasses in single and two-stage (acidogenesis + methanogenesis) AD were considered. Detailed energy balance analyses demonstrated that biogas production/processing is much more efficient than ethanol production, with energy return on investment levels (4.33-8.67) at least 4-fold higher than in the case of ethanol (1.06-1.32). Despite the relevant energetic contribution of H2 from substrate fermentation in some cases (up to 9\%), extremely high production costs eliminated any trace of economic competitiveness for H-2-producing biorefineries (internal rate of return - IRR < 16\%) compared to ethanol plants (IRR = 24.9\%). However, investing on substrate fermentation (without H-2 production) coupled to NaOH-supplied methanogenesis could maintain electricity-(IRR = 26.9\%) or biomethane-(IRR = 25.1\%) producing plants economically more attractive than ethanol production. While relatively minimum increments in the price of electricity would be necessary to support the first plants, both reducing investment costs coupled with valorizing biomethane would be essential in the latter. Hence, biogasproducing biorefineries may be more than a match for ethanol facilities, and sugarcane has a great potential to play the role of a leading feedstock within the context of energy transition.