They are the new legislators on the block — both young, both Democrats and both eager to begin their jobs on Beacon Hill representing the Cape and Islands in January.

Julian Cyr, a 30-year-old Truro native, was elected state senator on Tuesday for the district that includes the mid to outer Cape and two Islands. He will succeed Sen. Dan Wolf, who is stepping down after three terms.

Dylan Fernandes, a 26-year-old Falmouth native, was elected state representative for the district that includes the two Islands and part of Falmouth. He will succeed Rep. Timothy Madden, who is stepping down after four terms.

In telephone conversations with the Gazette this week, the two incoming freshman legislators said they had campaigned in tandem.

“I’m a real product of grass roots campaigns and that’s how I ran my own campaign,” said Mr. Cyr, the former director of policy and regulatory affairs for environmental health at the Massachusetts Department of Public Health, who prevailed over his opponent Anthony Schiavi.

“We had a people-to-people approach,” the state senator-elect said.

Mr. Fernandes, the former political and digital director for state Attorney General Maura Healey, who prevailed over his opponent Tobias Glidden, echoed the remarks.

“Our campaign was like Julian’s — a big grass roots effort focused on volunteers and neighbors talking to neighbors,” he said. “We knocked on well over 8,000 doors across the district. We walked down a lot of dirt roads in Chilmark. It was maybe not the most efficient way to contact voters, but that was our approach. We spent more than $2,000 on ferry tickets alone.”

The two candidates similarly echo each other on the issues, citing the opioid epidemic, affordable housing and the environment as top priorities.

“There is broad consensus in the district about the issues,” Mr. Cyr said. “The challenge now will be to figure out the policies that need to be addressed. How do you take these things and move them in a very parochial system?” he added.

Mr. Fernandes agreed. “Those are the core issues, the three we heard about over and over talking to people in the district,” he said. “We are looking forward to addressing these at the state level.”

Meanwhile, between now and January they expect to work on part-time staffing and develop a framework for communicating with voters in the district.

Mr. Fernandes said he plans to shortly begin what he called a listening tour around the district. “Now is the time to talk less and listen more to the concerns people are having,” he said.

And with the election now behind them, they spoke a bit more freely about a handful of state issues, from marijuana to the Steamship Authority.

Mr. Cyr said he had opposed the statewide recreational marijuana question primarily because it was poorly crafted. “The way it was written . . . . we will need to make fixes,” he said. “It’s not going to be swift, and there is not going to be a recreational marijuana store in the district anytime soon.”

And responding to an eleventh-hour stir that cropped up just before the election, Mr. Fernandes said he does not advocate moving Steamship Authority freight operations to New Bedford.

“I was pretty disappointed that came out at the last minute — I’ve never once said that I said I support moving the Steamship Authority to New Bedford,” the state representative-elect said. “What I have said — and stand by saying — was that I find it encouraging that the Steamship Authority is doing a study looking into whether it is viable. I will always support studies that look at local infrastructure especially in a district like ours where transportation is such a huge issue.

“And I’m very aware that the Steamship Authority is the lifeline for the Islands.”

Mr. Cyr said he is humbled at having won the election in a year when Democrats fared so poorly around the country.

“I am awed at this responsibility and also, frankly, a little terrified,” he said.