can i take the jr rapid train from gifu to toyota-shi in order to visit the toyota factory?I assume you refer to the train that runs along the JR Chuo Line from Nagoya to Kozoji and then runs along the Aichi Loop Line to Toyota. Note that the Aichi Loop Line section is non-JR. Therefore, Japan Rail Pass holders will have to pay a surcharge. The surcharge between Kozoji and Shin-Toyota Station is 590 yen one way.
I am afraid there are no JR tracks that go to Toyota.