HONG KONG — Forty-five ex-lawmakers and activists were sentenced to four to 10 years in prison Tuesday in Hong Kong’s biggest national security case under a Beijing-imposed law that crushed a once-thriving pro-democracy movement. They were tried under the 2020 national security law for their roles in an unofficial primary election.