The Stewart model of acid-base physiology is not commonly taught in medical school, but came up often in my residency training. It is very useful for predicting and explaining changes in acid-base status in this sort of scenario which is difficult to conceptualize by other approaches. Explaining the entire model is beyond this post, but there's a lot to read online.
In this situation, mannitol-induced osmotic diuresis causes increased sodium loss. The Strong Ion Difference, a determinant of acid-base in the Stewart model, is (Na + K + Mg + Ca) - (Cl + lactate), and a decrease in SID (such as that caused by sodium loss) will lead to increased liberation of free H+ and decreased pH, ie. metabolic acidosis.
As for the hyperkalemia, I don't think there is a consensus answer. Increased serum K+ can of course be caused by all acidosis, but mannitol may also raise K+ by inducing hemolysis or by a "solvent drag" phenomenon. The latter occurs when hypertonic infusions like mannitol induce shifts of fluid from the intracellular space, taking K+ with it. Interestingly, lower doses of mannitol have been observed to decrease K+ concentration.