Joint Enhancement of Relational Reasoning for Long-Context LLMs