Your question is a little bit puzzling. Madison and Jefferson, for the most part, worked together fairly well. They were each president for eight years, or two full terms, the maximum that any one person is allowed to be president according to the Constitution. They never ran against one another.
Perhaps you are thinking of the struggle between Jefferson and Hamilton.
Jefferson was the leader of the Democratic-Republican Party (not to be confused with today's Democratic or Republican parties). His mantra could be described as "power to the people". He was in favor of a small central government with individuals retaining as many rights as possible. He thought that the states should be stronger than the federal government. Jefferson also thought that agriculture should be the backbone of American society. His views were more compatible with small-town farmers and plantation owners, particularly in the South, than wealthier businessmen.
Hamilton was the leader of the Federalist Party. The Federalist Party was supported by bankers, doctors, lawyers, and other wealthier landowners because Hamilton was in favor of making up the ruling class from the wealthy. Hamilton believed that a strong central government would benefit the United States. Most of Hamilton's supporters were in New England. Hamilton's mantra could loosely be described as, "power to the rich".
While it is impossible to say who "won" in the sense that one person defeated or vanquished the other's ideas, Jefferson did win the presidency. He was president for eight years. The Federalist party eventually broke apart and disappeared in the early 1800s.