You are very close.
First, you need to update your key:
<xsl:key name="movies" match="movie" use="." />
By putting movie in the use=
you were saying "use movie that is under movie" which isn't correct.
Next, your for-each
is setting the context to ballot which means, based on your input, that it would run only twice. I believe you actually wanted the context to be movie so it would run over each movie that matched your key. That would look like the below:
<xsl:for-each select="//ballot/movie[generate-id()=generate-id(key('movies',.)[1])]">
<tr><xsl:value-of select="." /></tr>
</xsl:for-each>
As a side note, you will also want to fix the way the table is made since you are outputting only <tr>
for each movie with no <td>
or anything similar. But I'm sure you would get to that once this is fixed.