JAKARTA, Indonesia — Indonesia’s troubled legal system is again coming under scrutiny, after rulings in two high-profile cases that have alarmed both Western expatriates and local organizations that fight corruption in the country’s judiciary.

One involves a Canadian educator serving an 11-year term in a high-security prison on charges of sexually assaulting kindergartners at one of the country’s most prestigious international schools — a case the school and the man’s lawyers contend was fabricated.

The other is that of a powerful Indonesian politician who avoided prosecution in a corruption scandal, much to the chagrin of investigators here in one of Asia’s most graft-ridden nations.

The two men have never met, but their legal cases crossed paths on the same day last month, with the outcomes highlighting a system in which rulings often appear to hinge more on incompetence, bribery or public opinion than on facts, according to legal analysts.