Rashi in Genesis 48:7
אקברה שם. וְלֹא הוֹלַכְתִּיהָ אֲפִלּוּ לְבֵית לֶחֶם לְהַכְנִיסָהּ לָאָרֶץ, וְיָדַעְתִּי שֶׁיֵּשׁ בְּלִבְּךָ עָלַי; אֲבָל דַּע לְךָ שֶׁעַל פִּי הַדִּבּוּר קְבַרְתִּיהָ שָׁם, שֶׁתְּהֵא לְעֶזְרָה לְבָנֶיהָ כְּשֶׁיַּגְלֶה אוֹתָם נְבוּזַרְאֲדָן, וְהָיוּ עוֹבְרִים דֶּרֶךְ שָׁם, יוֹצֵאת רָחֵל עַל קִבְרָהּ וּבוֹכָה וּמְבַקֶּשֶׁת עֲלֵיהֶם רַחֲמִים, שֶׁנֶּאֱמַר קוֹל בְּרָמָה נִשְׁמָע וְגוֹ' וְהַקָּבָּ"ה מְשִׁיבָהּ יֵשׁ שָׂכָר לִפְעֻלָּתֵךְ נְאֻם ה' וְשָׁבוּ בָנִים לִגְבוּלָם (ירמיהו ל"א).
AND I BURIED HERE THERE and did not carry her even the short distance to Bethlehem to bring her into a city. I know that in your heart you feel some resentment against me. Know, however, that I buried her there by the command of God”. And the future proved that God had commanded him to do this in order that she might help her children when Nebuzaradan would take them into captivity. For when they were passing along that road Rachel came forth from her grave and stood by her tomb weeping and beseeching mercy for them, as it is said, (Jeremiah 31:15) “A voice is heard in Rama, [the sound of weeping … Rachel weeping for her children]”, and the Holy One, blessed be He, replied to her (v. 16) “There is a reward for thy work, says the Lord etc. (v. 17) for thy children will return to their own border”.
In Kinas for the Day of Tisha B'av Chapter 26, R' Elazar Haklir talks about the trip of Yirmiyahu to the Mearas Hamchpeila to awaken them to beseech G-D for mercy for their children. It is based on Medrash Eicha Rabbasi Introduction number 24. Although the Medrash does not mention the Imahos, only the Avos and Moshe, in the Kinna he clearly includes them.
אָז בַּהֲלוֹךְ יִרְמְיָהוּ עַל קִבְרֵי אָבוֹת וְנָם עֲצָמוֹת חֲבִיבוֹת מָה אַתֶּם שׁוֹכְבוֹת בְּנֵיכֶם גָּלוּ וּבָתֵּיהֶם חֲרֵבוֹת וְאַיֵּה זְכוּת אָבוֹת בְּאֶרֶץ תַּלְאוּבוֹת:
And then further in the Kinna;
קוֹל בְּכִי לֵאָה מְתוֹפֶפֶת עַל לְבָבֶהָ רָחֵל אֲחוֹתָהּ מְבַכָּה עַל בָּנֶיהָ זִלְפָּה מַכָּה פָּנֶיהָ בִּלְהָה מְקוֹנֶנֶת בִּשְׁתֵּי יָדֶיהָ:
So, even if Rachel had been buried in the Mearas Hamachpeila she would have heard about it through Yermiyahu. Why then did Yackov have to bury on the road so that the Children of Israel can stop by her kever and awaken her to beseech G-D? Even if she could not have been buried in the Mearas Hamachpeila because she gave a night to Leah, she could have been buried in the city and Yirmiyahu could of gone there to awaken her just like he did for Moshe Rabbeinu.