Flat bars only exist because the stems in the early days had inadequate clamps, so a traditionally shaped bar would rotate on bumps or under heavy braking.
A flat bar with bar ends puts your hands in a similar position to a traditional bar without the benefit of having the brakes to hand. If you like bar ends and aren’t a fashion victim, there’s a good case for dropbars on recreational mtbs*
A riser bar can be slightly more comfortable because it is a longer bar but the rise shortens it back to normal. The extra length gives slightly more flex.
The Mary bar is a variant of the Great North Road bar which was a popular bar because of its comfort with people who rode large distances for pleasure. Upright during the week for commuting, and flipped at the weekend for rides with the lads.
edit: * unfortunately they are a hassle to fit with current mtb brakes and gears because of the limited choice of brakes.