Which is better is dependent on the situation. Passing the state by argument is significantly more flexible and generally preferred (it will make testing easier, for one). But it can also get very verbose sometimes if you have a complicated call graph, which the static solution mitigates somewhat at the expense of making the program flow harder to understand and debug.
If you can replace a static mutex with a local variable, I'd always do it. But in my opinion you are comparing apples with oranges. The first snippet is not a drop-in replacement for the second one. Once you need more than one mutable reference (e.g. in a multi-threaded environment where more than one thread wants to write to ARRAY), the first snippet won't do, whereas the second one would (in most use-cases I'd still prefer to pass the mutex as argument around and not keep it as a static variable).