Why would one get an infection in an elbow a month after surgery there? Also has RA and many broken bones.

Immunosupression? Many medications that are used to treat rheumatoid arthritis can also suppress the immune system. That increases risk of infection or decreased wound healing. Prednisone can cause these side effects and it also can cause or worsen osteoporosis and lead to increased risk of fractures.
Not due to surgery? Uncertain if the infection was from the surgery. It may have been from another source. We know if you have rheumatoid arthritis you are at a greater risk of infection independently. It depends on the medications also. If there are broken bones we know people with RA have a great risk to develop osteoporosis which is related to an increased risk of fracture.