If was Social Security it is owed back, and if it was paid on the 3rd it is SS. It is for the prior month and if the recipient died before the end of the month it is owed back.
Talk to the bank. They should be able to electronically return the June payment it if it is still in her account. Its easier to have the bank do it than to write the IRS a check and wait for it to clear, etc. If the bank does it - you and the bank can prove it was returned if the IRS gives you future problems. My mother passed on March 30 and we had to return the March payment they sent in April. It doesn't seem fair it is not pro-rated, especially if a person is alive most of that month, but that is the govt for you!
With my parents, Social Security automatically pulled the money back out of my parent's direct deposit account. I didn't need to do anything. Social Security found out about my parent's passing from the funeral home.