OSX Unmount usb disk drive from Automator bash script
When run from Automator how are you inputting your password when prompted by sudo?  You're probably not being prompted if you're just running it the same way as if in Terminal.

You'll need to add some AppleScript code and run it via osascript so you're prompted for an Admin password:

osascript -e 'do shell script "sudo diskutil unmountDisk disk3" with administrator privileges'