As Brogan already pointed out, the ID is required to identify the attachment - the filename (which is used to generate the slug) is not necessarily unique.
It would be possible to change the slug format with custom code, but keep in mind that this would make the URL inconsistent with other XenForo URLs which are usually /prefix/<title>.<id>
.