You can compare their ids to see if they are the same.
{if $addresses.invoice.id eq $addresses.delivery.id}
like this
{if $addresses.invoice.id eq $addresses.delivery.id} <tr> <td width="100%" colspan="2"><span class="bold">{l s='Billing Address' d='Shop.Pdf' pdf='true'}</span><br/> {$invoice_address} </td> </tr> {else} <tr> <td width="50%"> {if $delivery_address}<span class="bold">{l s='Delivery Address' d='Shop.Pdf' pdf='true'}</span><br/> {$delivery_address} {/if} </td> <td width="50%"><span class="bold">{l s='Billing Address' d='Shop.Pdf' pdf='true'}</span><br/> {$invoice_address} </td> </tr> {/if}