A federal court on Monday upheld Hawaii’s law prohibiting citizens under 21 years old from purchasing firearms and ammunition.