Basically any build you can think of is viable if you know the tricks of the trade. There are a lot of tools in the game that are available to you to make things doable in most situations.
To answer your question, sure you can make a viable build with trash stats, but that is your prerogative. In this game having stats at 5 is going to be useless 90% of the time.
Just to explain, let's say we go with your idea. To max out your sledgehammer you want to max strength.
Now we have
STR 10
DEX 5
AGI 5
CON 5
PER 5
WILL 5
INT 5
the dex gives you absolutely nothing, the agi gives you access to 1 agility feat and nothing else, the con gives you access to conditioning, and a meager amount of hp, the per gives you nothing but a slight detection boost, the will gives you nothing, the int gives you access to a couple useful feats. And when I say nothing, I mean almost nothing. Like 10% more effective skill, which is nothing....
On the other hand, if you actually just make a character that is good at stuff - for example you want a tanky dude that swings a big hammer with persuasion, ok that's fine
http://underrail.info.tm/build/?AQoDBgoDAwUAAAAPAAAPAAAAAA8PAA8PAAAADwAMYzkthe 6 agi gives you sprint - vital for melee characters to get into range, 10 con makes you tanky as hell and opens up a bunch of feats, 5 int is good for some melee feats and will allow you to craft decent gear, 10 strength maxes your sledge power.
Bam, you have the a much better character than the one you requested, who is actually good at the stuff they wanna do. you get max persuasion per level through your skill synergy with mercantile. You can craft. you can change these skillpoints around to use evasion, dodge, hacking lockpick, whatever....