Natural Resources Wales (NRW) - which is objecting to the £1.1bn project - said the likely impact of climate change had be taken into account.
NRW was giving evidence at a public inquiry into the plans in Newport.
Lawyers for the Welsh Government said it was "inconceivable" sea defences would not be maintained.
The proposed route of the relief road would cross areas of tidal floodplain within the Severn Estuary on a raised embankment.
Gary Purnell, a technical specialist for NRW's flood risk analysis team, told the inquiry that proposals to manage tidal flood risk had not been guaranteed over the lifetime of the project.
An assumption that defences would be maintained was not satisfactory, he said.
The proposed M4 scheme would increase tidal flooding risk to properties south of the new motorway, whilst benefiting properties to the north, he claimed.
Should sea defences not be improved throughout the lifetime of the scheme there was a "serious risk of flooding in that area" in light of climate change.
Commitments to flood protection had been made in the case of the HS2 project and the Thames Tideway Tunnel, he added.
But Morag Ellis QC, representing the Welsh Government, said for NRW to query whether funding would be available was to "underplay the serious risk" that climate change posed in future.
It was the government's position that it was "inconceivable" that measures would not be put in place, otherwise vast areas of Newport and Cardiff as well as important road infrastructure, power lines and industry would be at threat, she said.
She added it was not for NRW to question government policy or the allocation of funding and that both these issues were beyond the scope of the inquiry.
NRW's evidence will continue with objections set to be discussed surrounding the road's impact on Sites of Special Scientific Interest and protected species such as dormice.
The inquiry heard that following weeks of dialogue and work to address issues between Welsh Government and NRW officials, a number of other objections had been removed.

Andy Beynon, 52, from Llanelli, Carmarthenshire, died on the B4268 between Pentre Meyrick Cross and Llysworney.
His wife said he was the "love of my life" who dedicated his time to helping children with special needs.
The crash involved Mr Beynon's motorbike and a Land Rover Freelander.
In a statement, his wife Dawn said: "Andy lost his life enjoying one of his many pleasures - riding his motorcycle.
"He was out that day giving his free time to teach others how to become a better rider.
"He was a loving husband, father, grandfather, brother - a family man - with many, many friends.
"He dedicated his time to help others and work tirelessly helping children with exceptional special needs. The children utterly adored him - he just had that 'special gift' to make them smile."
A long-term commitment to fund flood defences along the route of the M4 relief road is needed before the scheme goes ahead, it has been argued.
[NEXT_CONCEPT]
A motorcyclist killed in a crash in the Vale of Glamorgan on Saturday has been described as "the love of my life" by his wife.