Yes, both are wrong. Equating them as the same because they end up with the same end result — death — is naive and simplistic. Indonesia, despite its corruption, is a legitimate power who legitimately put people to death it deemed as criminals worthy of death. The Islamic State has no such bona fides.
You’re also focusing on the west and putting Indonesia up to a western standard. Not helpful for Indonesia, and it is condescending to assume it’s the natural progression of things that these non-western states will stop executing. Can you see a time when Iran, China, Egypt and North Korea no longer execute? I can’t, barring some sort of revolutionary change in government. I can’t even when we are looking at scales of time in the hundreds of years.