At least 24 people have died after a boat capsized carrying people to a funeral in Nigeria, according to emergency services.