The prefixes un- and in- (leading to im) are cognate according to the OED, but they reached the English language by different (germanic vs. latin) paths. Due to this, as it often happens, each carved out its niche. Again according to OED, imbalance was "Orig. a technical term in Ophthalmology", which then took on a more general use, my guess is because -mb- is less demanding for the tongue than -nb-.