There are at least three possibilities:
First, numbers were difficult for the Hebrew scribes to write accurately. Therefore, it is possible that this is a copyist error (see comments on Exodus 12:37).
Second, it is also possible that they wrote their lists at different times. Remember, Nehemiah began his ministry twelve years after Ezra. He could be describing a different wave of return to Israel. Historically, the Jews were deported from Israel in three separate waves; it is possible that they returned to Israel in multiple waves.
Third, it is also possible that Ezra recorded WHO LEFT and Nehemiah was recording WHO MADE IT. Consider, for example, if Ezra was just recording who left, and many family members joined up with them on their way to Israel. Others died. Thus these two figures would be different from one another.