Decomposition of sucrose begins at temperatures around first crack (185-190C). Depending on degree of roast, a roaster may be able to preserve a good part of what was initially contained in a green bean. Which, of course, is relative to the plant itself, its growing conditions, harvest timing and subsequent processing methodology.
Among other compounds, numerous other (complex) carbohydrate structures can be found in a green bean - starch/cellulose for instance. Then, there are or alcohols (esp. glycols) present. Some of these organic compounds are being re-formed into intermediate products, cracked and broken down during and after a roast (instable molecules during resting period, degassing being a by-product of this molecular disintegration).
Extraction obviously plays a big role in unlocking, as well as enabling physical and chemical reactions to produce flavours.
The outcome doesn't necessarily be a type of sugar to evoke sweetness. Aforementioned glycols do taste sweet, as do certain amino acids. Also, taste notes that remind us of sugary fruit (dried fruit, ripe berries, tropical fruit, etc.) or chocolate, caramel and so on are able to shift your perception a bit.