After an injury, the lumps could be localized collection of blood (hematoma) or abscess (collection of pus). Since it is painful, either they are infected hematomas or abscesses.
They can also be swollen lymph nodes. Pain in back of thigh can also be due to pinched nerve in lower back. Take care!
The medical advice given should not be considered a substitute for medical care provided by a doctor who can examine you. The advice may not be completely correct for you as the doctor cannot examine you and does not know your complete medical history. Hence this reply to your post should only be considered as a guiding line and you must consult your doctor at the earliest for your medical problem.