In this case, you want your bash function to essentially work like a standalone script. Using it as a bash_alias doesn't work because sudo isn't aware of it. When you do sudo trash somefile, it looks for that script in /root/.bash_alias, not /home/youruser/.bash_alias. Because this function only exists as a bash_alias in your own user's home directory, sudo/root says it doesn't exist. All you need to do is make your function available to all users, including sudo (root).
You can get around this by either adding your alias to the end of your /etc/profile file which would make all users globally aware of the function, or you can create a bash script at /usr/bin/trash to perform the same essential function. In the later scenario, you would also want to do sudo chmod 755 /usr/bin/trash so that all users could execute the program.
Either way would work in your case, but I suggest the /etc/profile method, since it's just a simple alias function for moving files to trash. There's no reason to restrict it for other users. Always remember to consider the security implications of making a bash_alias available to all users.
Hope that helps. :)