From the entry of 精選版日本国語大辞典:
※闇桜(1892)〈樋口一葉〉「あらマア何(どう)しませうねへ」
So the word form is attested at least since late 19th century.
As you said, this is a combination of あら + まあ. あら can be traced back to the 10th century and まあ to the 18th century with basically the same meaning as in today (interjection of amazement).
※落窪(10C後)一「あらことごとし」
※洒落本・妓者呼子鳥(1777)四「そりゃアマアほんの事かへ」
Thus it should be natural to assume that it has developed independently from the Malay phrase, and their resemblance is a coincidence. Of course, one can argue that the either side of people learned the specific word used in the other and mimicked the phrase by a novel combination of native components, but that would be difficult to prove or disprove.