In my opinion, the Arthashastra was written first.
The Arthashastra was written by Kautilya (Chanakya), who was the advisor and Prime Minister of Chandragupta Maurya. He was associated with Chandragupta from the very beginning and guided him in establishing the Mauryan Empire, so the Arthashastra reflects the foundational period of Mauryan rule.
The Indika, on the other hand, was written by Megasthenes, the Greek ambassador sent to Chandragupta's court by Seleucus Nicator. Megasthenes came to India only after Chandragupta defeated Seleucus around 305 BCE, which was a later stage of Chandragupta's reign.
Since Kautilya was with Chandragupta right from the founding of the empire while Megasthenes arrived only after 305 BCE, the Arthashastra was, in my opinion, written before the Indika.