Late reply, but today I managed to figure out how to make it replace an existing file: One has to add the X-Method-Override: PUT header. E.g.
curl -T somefile -u "abcd1234:some_password" -H 'X-Requested-With: XMLHttpRequest' -H 'X-Method-Override: PUT' https://somedomain.com/public.php/webdav/
will upload the file somefile to the share abcd1234 with password some_password at the server somedomain.com. If the file exists, it will be replaced.