Thai leader faces court ruling that could cost him his job