The US, Australia and rights groups slammed the sentencing as evidence of the erosion of political freedoms in the city since Beijing imposed a security law in 2020.