Austria’s centrist government passed the new law, which takes effect next year, after years of pressure from the far right.