The new Mamiya and the 645D are two very different digital medium format cameras.
Yes both are 40Mp, but that is about the only thing that is similar between them.
The Mamiya has faster continous shooting and more bits to the D/A conversion (which means nothing in real world, but still - it has it).
Now, the 645D has a modern AF system with 9 cross sensors and supporting in-lens motors. It also ha 77 segment metering and different image tones for photographers that wants to be creative in the camera instead of being post processing professionals. (image tones are like using different films...).
The 645D is weather sealed and cold protected and the first lens for it is also weather sealed and cold protected.
The 645D goes up to ISO 1000, the Mamiya stops at ISO 800.
The 645D has Pentax standard HyperProgram controls, multiple exposure and many other neat things borrowed from their top DLSR's.
So the Mamiya has speed and is more expensive.
The Pentax has everything else at a lower price.
The choice is yours...
I wouldn't say that the 645D looses out to the competition. It depends what you want in a camera. The 645D has more features than the Mamiya and combines this with a rugged built designed for outdoor use.