Was Ernakulam junction the closest train station to kochi and is that where you got off?
Yes. Sorry, I should have mentioned that the station was in Ernakulam. As suggested by our hotel in Kozhikode, we got off in Ernakulam Town and then took a taxi across the Goshree/Vallarpadam Bridges to the Vypeen Ferry Junction and then a quick ferry to Fort Kochi. Fun ride! Our taxi driver stayed with us on the ferry and then took us to our guesthouse. He told us that it is actually faster than trying to get across the bridges and Willingdon Island further south, even with added the ferry ride.
I’m trying to figure out how and where to catch the train from kochi to Trivandrum.
Follow lifesupport's suggestions above. We hired a car/driver From Fort Kochi to Alappuzha, another car/driver on to Kollam and the same again to Varkala. Car/driver is definitely the most comfortable and fast, if you don't get stuck in bad traffic. Luckily we didn't. We found going to the nearest taxi stop and haggling with the drivers there got us a cheaper rate than through our hotel. They will start out with a high rate (sometimes extraordinarily high) and usually came down after some firm, but friendly haggling. It won't be cheap. For a few shorter distances we found that we could fit it in our budget. That being said, the trains are not at all a bad choice. For really long distances we flew. We only took buses when there was no other choice.