Compare optimal seated riding postions for different "fields" in mountain biking I remember seeing an illustration, in some article, of different riding positions. The cross-country guy leans low and forward, while the enduro rider was close to standing straight up. Both were represented riding seated at level ground.

Is this true? Are different mountain bike types characterized by specific height of the handlebars, relative to the saddle, and specific length of the headtube + stem? What motivates such design decisions?
The position does change from one discipline to another. There are no fixed values or ratios, but, at least until recently the differences were significant. 

In the early day of mountain biking racing cross country was a long race (almost 3 hours) with few technical sections. Since these races were flatter, it was thought that aerodynamics could play a bigger role. Therefore the rider's frontal area was reduced with narrow handlebars seat much higher than bars, and longer effective top tube. Long stems came naturally to make up for short bars to make steering less nervous. 

Then came the big split into numerous disciplines and different frame geometries came up for cross country, four cross, dirt jumping, enduro, downhill, freeride etc. Disciplines such as enduro required better bike handling and safety on steep slopes, therefore handlebars are wider, top tube is shorter and head tube is longer. This plus the fact that enduro was often defined as relaxed riding on mountain paths (it's still an arguable definition) caused rider's trunk to be almost vertical, which is more comfortable on a long trip. 
Note: there are way more differencees in geometries for various disciplines, but we're only talking about rider's upper body position.

These days as world cup XC courses become more technical, cross country bikes get wider bars and a position safer on downhills. Tarmac/gravel sections are now much shorter so aerodynamic drag isn't an issue anymore (has it ever been?) and while top tubes on XC bikes are still longer (for better ascents) we can currently see more and more similarities between XC and gravity-sport bikes.