In a ruling issued on Tuesday, a federal judge upheld an earlier decision requiring Maryland and the federal government to take into consideration Metro’s ongoing safety problems and ridership declines as part of assessments for the Purple Line.