Do you have, or can you install, lftp ? It is a scriptable FTP client that can use several protocols, including SFTP.
One of lftp 's commands is cls which could be used to make a listing of filename and date which could then be processed locally to identify files to be deleted. It won't be pretty. The man page can be found here so that you can read it and decide whether you want to go this route. (The man page doesn't actually give any information about 'cls' unfortunately)
You could also do an ls -l in your first sftp and capture the output to a (local) file. You can then work out which files to delete and call an appropriate second sftp to delete the files.
You might be better to write your commands in a temporary file and use the -b flag of sftp to run it in batch mode.