20-year decline in year 12 science and maths participation, study finds