South America’s largest country is electing its next president later this year — and it’s in the thick of a legal battle about whether the top-polling candidate will be in jail by that time.