The important thing to remember first and foremost is this: The immediate family of the deceased are the number one priority at a funeral. No one should do anything that will be upsetting to the grieving family, and this includes the attendance of someone they would be upset to see.
That being said – you will need to ultimately decide based on the relationships that the ex-wife and her husband have with the deceased 1st husband’s family. If the relationships are great, then the attendance likely would not upset anyone. Anything less than great or good, then I would say stay away.
I hope this was helpful to you but for additional tips on this, please see our article: Should You Attend the Funeral.