Singapore stun Thailand to emerge third