A federal judge ruled that Trump cannot enforce parts of an executive order he issued last year about how elections are run.