What chemical(s) gives molasses its flavor so that it is used as an ingredient?
There is no single "molasses molecule". It's a complex flavor from a complex combination of chemicals. There is no "caramel molecule" either. It also contains several different types of sugar (mono- and disaccharides), which impart their own flavor and calories.

It will include residual sugars, all the types of molecules produced during caramelization, along with a wide varieties of proteins and miscellaneous not-sugar-things that are found in sugar cane juice. McGee lists a breakdown of 35% sucrose, 20% invert sugars, and 10% minerals (for blackstrap). There's also some water and other organic material, as that obviously does not add up to 100%.