Mexico left it late to secure their place in the CONCACAF Gold Cup semi-final with a 1-0 win over a plucky Trinidad and Tobago side.